@bytebrand/fe-ui-core 4.8.46 → 4.8.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/bytebrand-fe-ui-core-4.8.47.tgz +0 -0
  2. package/media/locales/de/promoSlider.json +0 -1
  3. package/media/locales/en/promoSlider.json +0 -1
  4. package/package.json +5 -3
  5. package/source/components/AccordionWidget/AccordionWidget.styl +0 -1
  6. package/source/components/AccordionWidget/AccordionWidget.tsx +4 -8
  7. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
  8. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -1
  9. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +9 -8
  10. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -5
  11. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +1 -3
  12. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
  13. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +11 -24
  14. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
  15. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +1 -4
  16. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +2 -3
  17. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
  18. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +6 -15
  19. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
  20. package/source/components/_common/withStats/withStats.styl +21 -0
  21. package/source/components/_common/withStats/withStats.tsx +21 -4
  22. package/source/framework/DataTransformers.ts +0 -1
  23. package/source/framework/constants/common.ts +4 -8
  24. package/source/framework/types/types.ts +0 -1
  25. package/source/framework/vehiclesProps/decoratedLightProps.tsx +12 -48
  26. package/source/framework/vehiclesProps/decoratedProps.tsx +8 -35
  27. package/source/locales/data.ts +5 -4
  28. package/.husky/pre-push +0 -4
  29. package/.storybook/addons.js +0 -4
  30. package/.storybook/config.js +0 -64
  31. package/.storybook/postcss.config.js +0 -6
  32. package/.storybook/preview-head.html +0 -10
  33. package/.storybook/webpack.config.js +0 -130
  34. package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +0 -42
  35. package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +0 -50
  36. package/__tests__/components/Checkout/RadioGroup.test.tsx +0 -95
  37. package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +0 -53
  38. package/__tests__/components/Checkout/Switcher.test.tsx +0 -43
  39. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
  40. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
  41. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +0 -127
  42. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +0 -58
  43. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +0 -74
  44. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +0 -62
  45. package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +0 -117
  46. package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +0 -58
  47. package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +0 -88
  48. package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +0 -91
  49. package/__tests__/components/_common/Badge/Badge.test.tsx +0 -15
  50. package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +0 -23
  51. package/__tests__/components/_common/Image/Image.test.tsx +0 -82
  52. package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +0 -49
  53. package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +0 -54
  54. package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +0 -58
  55. package/__tests__/components/_common/StarButton/StarButton.test.tsx +0 -46
  56. package/__tests__/mockedData/financingConfig.js +0 -202
  57. package/__tests__/mockedData/mockedPendingRequestedCar.js +0 -69
  58. package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +0 -18
  59. package/__tests__/utils/CommonUtils/arrToObj.test.js +0 -32
  60. package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +0 -17
  61. package/__tests__/utils/CommonUtils/fixNumber.test.ts +0 -20
  62. package/__tests__/utils/CommonUtils/formatMileage.test.ts +0 -8
  63. package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +0 -22
  64. package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +0 -19
  65. package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +0 -19
  66. package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +0 -51
  67. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +0 -64
  68. package/__tests__/utils/CommonUtils/getPriceRating.test.ts +0 -26
  69. package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +0 -33
  70. package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +0 -9
  71. package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +0 -23
  72. package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +0 -23
  73. package/source/components/AdvantageItem/AdvantageItem.story.js +0 -23
  74. package/source/components/Alternative/Dealer.story.js +0 -32
  75. package/source/components/Alternative/Dealer.story.styl +0 -3
  76. package/source/components/Breadcrumbs/Breadcrumbs.story.js +0 -40
  77. package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +0 -45
  78. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +0 -243
  79. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +0 -21
  80. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +0 -105
  81. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +0 -37
  82. package/source/components/Checkout/Switcher/Switcher.story.js +0 -41
  83. package/source/components/Checkout/Switcher/Switcher.story.styl +0 -2
  84. package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +0 -187
  85. package/source/components/ContactForm/ContactForm.story.js +0 -94
  86. package/source/components/ContactForm/ContactForm.story.styl +0 -0
  87. package/source/components/ContactInfo/ContactInfo.story.js +0 -58
  88. package/source/components/CustomerQuote/CustomerQuote.story.js +0 -41
  89. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +0 -73
  90. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +0 -5
  91. package/source/components/FormattedNumber/FormattedNumber.story.js +0 -114
  92. package/source/components/InfoBlocks/InfoBlockWrapper.story.js +0 -101
  93. package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +0 -46
  94. package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +0 -97
  95. package/source/components/OfferPanel/OfferPanel.story.js +0 -139
  96. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +0 -35
  97. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +0 -3
  98. package/source/components/PriceRating/PriceRating.story.js +0 -39
  99. package/source/components/PriceRating/PriceRating.story.styl +0 -2
  100. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +0 -78
  101. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +0 -11
  102. package/source/components/RateSearchValue/RateSearchValue.story.js +0 -78
  103. package/source/components/RateSearchValue/RateSearchValue.story.styl +0 -2
  104. package/source/components/RateSearchWidget/RateSearchWidget.story.js +0 -57
  105. package/source/components/RateSearchWidget/RateSearchWidget.story.styl +0 -12
  106. package/source/components/SearchFilters/FiltersFactory.story.js +0 -273
  107. package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +0 -12
  108. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +0 -834
  109. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +0 -40
  110. package/source/components/SearchWidget/SearchWidget.story.js +0 -191
  111. package/source/components/SearchWidget/SearchWidget.story.styl +0 -6
  112. package/source/components/Stepper/Stepper.story.js +0 -119
  113. package/source/components/Stepper/Stepper.story.styl +0 -41
  114. package/source/components/Theme.story.js +0 -36
  115. package/source/components/Theme.story.styl +0 -85
  116. package/source/components/TickerText/TickerText.story.js +0 -17
  117. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +0 -95
  118. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +0 -97
  119. package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +0 -31
  120. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +0 -247
  121. package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +0 -30
  122. package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +0 -18
  123. package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +0 -19
  124. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +0 -44
  125. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +0 -120
  126. package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +0 -42
  127. package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +0 -62
  128. package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +0 -42
  129. package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +0 -412
  130. package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +0 -56
  131. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +0 -199
  132. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +0 -40
  133. package/source/components/_common/Accordion/Accordion.story.js +0 -36
  134. package/source/components/_common/Badge/Badge.story.js +0 -27
  135. package/source/components/_common/Badge/Badge.story.styl +0 -5
  136. package/source/components/_common/Bubble/Bubble.story.js +0 -52
  137. package/source/components/_common/Button/Button.story.js +0 -52
  138. package/source/components/_common/Button/Button.story.styl +0 -5
  139. package/source/components/_common/ButtonOld/Button.story.js +0 -54
  140. package/source/components/_common/ButtonOld/Button.story.styl +0 -5
  141. package/source/components/_common/Checkbox/Checkbox.story.js +0 -85
  142. package/source/components/_common/Checkbox/Checkbox.story.styl +0 -14
  143. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +0 -126
  144. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +0 -14
  145. package/source/components/_common/Chip/Chip.story.js +0 -43
  146. package/source/components/_common/ChipList/ChipList.story.js +0 -36
  147. package/source/components/_common/DropDown/DropDown.story.js +0 -35
  148. package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +0 -41
  149. package/source/components/_common/Histogram/Histogram.story.js +0 -51
  150. package/source/components/_common/IconSVG/IconSVG.story.js +0 -21
  151. package/source/components/_common/IconSVG/IconSVG.story.styl +0 -25
  152. package/source/components/_common/Image/Image.story.js +0 -142
  153. package/source/components/_common/Image/Image.story.styl +0 -18
  154. package/source/components/_common/ImagesSet/ImagesSet.story.js +0 -34
  155. package/source/components/_common/ImagesSet/ImagesSet.story.styl +0 -4
  156. package/source/components/_common/Loader/Loader.story.js +0 -21
  157. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +0 -49
  158. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +0 -45
  159. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +0 -6
  160. package/source/components/_common/MaterialField/MaterialField.story.js +0 -87
  161. package/source/components/_common/MaterialField/MaterialField.story.styl +0 -34
  162. package/source/components/_common/MaterialSelect/MaterialSelect.story.js +0 -52
  163. package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +0 -6
  164. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +0 -47
  165. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +0 -6
  166. package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +0 -17
  167. package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +0 -10
  168. package/source/components/_common/Modal/Modal.story.js +0 -37
  169. package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +0 -21
  170. package/source/components/_common/PropertySelector/PSGroup.story.js +0 -93
  171. package/source/components/_common/PropertySelector/PSGroup.story.styl +0 -25
  172. package/source/components/_common/PropertySelector/ProperySelector.story.js +0 -83
  173. package/source/components/_common/Radio/FormRadioGroup.story.js +0 -28
  174. package/source/components/_common/Radio/FormRadioGroup.story.styl +0 -2
  175. package/source/components/_common/Radio/Radio.story.js +0 -54
  176. package/source/components/_common/Radio/RadioGroup.story.js +0 -90
  177. package/source/components/_common/Radio/RadioGroup.story.styl +0 -39
  178. package/source/components/_common/Range/Range.story.js +0 -46
  179. package/source/components/_common/Range/Range.story.styl +0 -5
  180. package/source/components/_common/SliderArrow/SliderArrow.story.js +0 -18
  181. package/source/components/_common/Tabs/Tabs.story.js +0 -56
  182. package/source/components/_common/TimePicker/TimePicker.story.js +0 -37
  183. package/source/components/_common/Tooltip/Tooltip.story.js +0 -28
  184. package/source/components/_common/UserMenu/MaterialMenu.story.js +0 -73
  185. package/source/components/_common/VehicleSlider/VehicleSlider.story.js +0 -99
  186. package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
  187. package/source/components/_common/withLabel/withLabel.story.js +0 -62
  188. package/source/components/_common/withPopover/withPopover.story.js +0 -48
  189. package/source/components/_common/withPopover/withPopover.story.styl +0 -54
  190. package/source/components/_common/withStats/withStats.story.js +0 -75
@@ -124,10 +124,6 @@ const getDecoratedLightProps = (
124
124
  const wltpConsumptionCombined = car.consumption.wltpCombined;
125
125
  const wltpCo2 = car.environmentEmissions.wltpCo2;
126
126
  const consumptionPowerCombined = car.consumption.consumptionCombined;
127
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
128
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
129
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
130
- : null;
131
127
 
132
128
  const co2 = car.environmentEmissions.co2;
133
129
 
@@ -147,9 +143,7 @@ const getDecoratedLightProps = (
147
143
  ? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
148
144
  : t('vehicleProps:value.na');
149
145
 
150
- const consumptionPowerCombinedContent = Number.isFinite(consumptionPowerCombined)
151
- ? t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
152
- : null;
146
+ const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
153
147
 
154
148
  const co2Value = Number.isFinite(co2)
155
149
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
@@ -168,24 +162,22 @@ const getDecoratedLightProps = (
168
162
  {`${wltpWeightedPowerCombinedContent}, `}
169
163
  {`${wltpWeightedCombinedContent}, `}
170
164
  {wltpCo2PluginValue}
171
- {co2ClassValue && <>, {co2ClassValue}</>}
172
165
  </React.Fragment>
173
166
  }
174
167
 
175
168
  return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
176
169
  ? <React.Fragment>
177
170
  {consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionValue} <br /> {co2Value}
178
- {co2ClassValue && <>, {co2ClassValue}</>}
179
171
  </React.Fragment>
180
172
  : t('vehicleProps:value.na');
181
173
 
182
174
  }
183
175
 
184
176
  if (wltpConsumptionValue && wltpCo2Value) {
185
- return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
177
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
186
178
  }
187
179
 
188
- return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
180
+ return <>{consumptionValue} <br /> {co2Value}</>;
189
181
  }
190
182
  },
191
183
  consumptionPowerCombinedAlternateView: {
@@ -199,10 +191,6 @@ const getDecoratedLightProps = (
199
191
  const co2 = car.environmentEmissions.co2;
200
192
  const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
201
193
  const wltpCo2 = car.environmentEmissions.wltpCo2;
202
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
203
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
204
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
205
- : null;
206
194
 
207
195
  const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
208
196
  ? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
@@ -221,10 +209,10 @@ const getDecoratedLightProps = (
221
209
  : t('vehicleProps:value.na');
222
210
 
223
211
  if (wltpConsumptionValue && wltpCo2Value) {
224
- return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
212
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
225
213
  }
226
214
 
227
- return <>{consumptionValue} <br /> {co2Value} {co2ClassValue && <>, {co2ClassValue}</>}</>;
215
+ return <>{consumptionValue} <br /> {co2Value} </>;
228
216
  }
229
217
  },
230
218
 
@@ -245,12 +233,8 @@ const getDecoratedLightProps = (
245
233
 
246
234
  const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
247
235
  const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
248
- const wltpWeightedPowerCombinedContent = Number.isFinite(wltpWeightedPowerCombined)
249
- ? t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
250
- : null;
251
- const wltpWeightedCombinedContent = Number.isFinite(wltpWeightedCombined)
252
- ? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
253
- : null;
236
+ const wltpWeightedPowerCombinedContent = t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit });
237
+ const wltpWeightedCombinedContent = t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
254
238
  const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
255
239
  ? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
256
240
  : null;
@@ -261,10 +245,6 @@ const getDecoratedLightProps = (
261
245
 
262
246
  const co2 = car.environmentEmissions.co2;
263
247
  const wltpCo2 = car.environmentEmissions.wltpCo2;
264
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
265
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
266
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
267
- : null;
268
248
 
269
249
  const co2Value = Number.isFinite(co2)
270
250
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
@@ -286,7 +266,6 @@ const getDecoratedLightProps = (
286
266
  {`${wltpWeightedPowerCombinedContent}, `}
287
267
  {`${wltpWeightedCombinedContent}, `}
288
268
  {wltpCo2PluginValue}
289
- {co2ClassValue && <>, {co2ClassValue}</>}
290
269
  </React.Fragment>
291
270
  }
292
271
  }
@@ -296,14 +275,12 @@ const getDecoratedLightProps = (
296
275
  {`${wltpConsumptionPowerCombinedContent}, `}
297
276
  {`${wltpWeightedCombinedContent}, `}
298
277
  {wltpCo2PluginValue}
299
- {co2ClassValue && <>, {co2ClassValue}</>}
300
278
  </React.Fragment>
301
279
  }
302
280
 
303
281
  return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
304
282
  ? <React.Fragment>
305
283
  {consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionCombinedContent} <br /> {co2Value}
306
- {co2ClassValue && <>, {co2ClassValue}</>}
307
284
  </React.Fragment>
308
285
  : t('vehicleProps:value.na');
309
286
  }
@@ -320,10 +297,6 @@ const getDecoratedLightProps = (
320
297
  const co2 = car.environmentEmissions.co2;
321
298
  const wltpConsumptionCombined = car.consumption.wltpCombined;
322
299
  const wltpCo2 = car.environmentEmissions.wltpCo2;
323
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
324
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
325
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
326
- : null;
327
300
 
328
301
  const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
329
302
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
@@ -341,10 +314,10 @@ const getDecoratedLightProps = (
341
314
  : null;
342
315
 
343
316
  if (wltpConsumptionValue && wltpCo2Value) {
344
- return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
317
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
345
318
  }
346
319
 
347
- return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
320
+ return <>{consumptionValue} <br /> {co2Value}</>;
348
321
  }
349
322
  },
350
323
  consumptionGasCombinedAlternateView: {
@@ -358,10 +331,6 @@ const getDecoratedLightProps = (
358
331
  const co2 = car.environmentEmissions.co2;
359
332
  const wltpConsumptionCombined = car.consumption.wltpCombined;
360
333
  const wltpCo2 = car.environmentEmissions.wltpCo2;
361
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
362
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
363
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
364
- : null;
365
334
 
366
335
  const consumptionValue = Number.isFinite(consumptionGasCombined)
367
336
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
@@ -380,10 +349,10 @@ const getDecoratedLightProps = (
380
349
  : null;
381
350
 
382
351
  if (wltpConsumptionValue && wltpCo2Value) {
383
- return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
352
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
384
353
  }
385
354
 
386
- return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
355
+ return <>{consumptionValue} <br /> {co2Value}</>;
387
356
  }
388
357
  },
389
358
  consumptionCombinedDealer: {
@@ -395,7 +364,6 @@ const getDecoratedLightProps = (
395
364
  const translatedUnit = t(`cbd:${consumptionUnit}`);
396
365
 
397
366
  const co2 = car.environmentEmissions.co2;
398
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
399
367
 
400
368
  const consumptionValue = Number.isFinite(consumptionCombined)
401
369
  ? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
@@ -405,11 +373,7 @@ const getDecoratedLightProps = (
405
373
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
406
374
  : t('vehicleProps:value.na');
407
375
 
408
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
409
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
410
- : null;
411
-
412
- return <>{consumptionValue} | {co2Value}{co2ClassValue ? <> | {co2ClassValue}</> : null}</>;
376
+ return <>{consumptionValue} | {co2Value}</>;
413
377
  }
414
378
  },
415
379
  gearbox: {
@@ -680,7 +680,6 @@ const getDecoratedProps = (
680
680
  const translatedUnit = t(`cbd:${consumptionUnit}`);
681
681
  const wltpConsumptionCombined = car.consumption.wltpCombined;
682
682
  const wltpCo2 = car.environmentEmissions.wltpCo2;
683
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
684
683
 
685
684
  const co2 = car.environmentEmissions.co2;
686
685
 
@@ -700,15 +699,11 @@ const getDecoratedProps = (
700
699
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
701
700
  : t('vehicleProps:value.na');
702
701
 
703
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
704
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
705
- : null;
706
-
707
702
  if (wltpConsumptionValue && wltpCo2Value) {
708
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
703
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
709
704
  }
710
705
 
711
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
706
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
712
707
  }
713
708
  },
714
709
  consumptionPowerCombinedAlternateView: {
@@ -721,7 +716,6 @@ const getDecoratedProps = (
721
716
  const co2 = car.environmentEmissions.co2;
722
717
  const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
723
718
  const wltpCo2 = car.environmentEmissions.wltpCo2;
724
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
725
719
 
726
720
  const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
727
721
  ? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
@@ -739,15 +733,11 @@ const getDecoratedProps = (
739
733
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
740
734
  : t('vehicleProps:value.na');
741
735
 
742
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
743
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
744
- : null;
745
-
746
736
  if (wltpConsumptionValue && wltpCo2Value) {
747
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
737
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
748
738
  }
749
739
 
750
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
740
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
751
741
  }
752
742
  },
753
743
  consumptionHydrogenCombinedAlternateView: {
@@ -760,7 +750,6 @@ const getDecoratedProps = (
760
750
  const translatedUnit = t(`cbd:${consumptionUnit}`);
761
751
  const co2 = car.environmentEmissions.co2;
762
752
  const wltpCo2 = car.environmentEmissions.wltpCo2;
763
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
764
753
 
765
754
  const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
766
755
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
@@ -778,15 +767,11 @@ const getDecoratedProps = (
778
767
  ? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
779
768
  : null;
780
769
 
781
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
782
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
783
- : null;
784
-
785
770
  if (wltpConsumptionValue && wltpCo2Value) {
786
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
771
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
787
772
  }
788
773
 
789
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
774
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
790
775
  }
791
776
  },
792
777
  consumptionGasCombinedAlternateView: {
@@ -800,7 +785,6 @@ const getDecoratedProps = (
800
785
 
801
786
  const co2 = car.environmentEmissions.co2;
802
787
  const wltpCo2 = car.environmentEmissions.wltpCo2;
803
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
804
788
 
805
789
  const consumptionValue = Number.isFinite(consumptionGasCombined)
806
790
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
@@ -818,15 +802,11 @@ const getDecoratedProps = (
818
802
  ? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
819
803
  : null;
820
804
 
821
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
822
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
823
- : null;
824
-
825
805
  if (wltpConsumptionValue && wltpCo2Value) {
826
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
806
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
827
807
  }
828
808
 
829
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
809
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
830
810
  }
831
811
  },
832
812
 
@@ -861,7 +841,6 @@ const getDecoratedProps = (
861
841
 
862
842
  const co2 = car.environmentEmissions.co2;
863
843
  const wltpCo2 = car.environmentEmissions.wltpCo2;
864
- const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
865
844
  const co2Value = Number.isFinite(co2)
866
845
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
867
846
  : t('vehicleProps:value.na');
@@ -871,9 +850,6 @@ const getDecoratedProps = (
871
850
  const wltpCo2PluginValue = Number.isFinite(wltpCo2)
872
851
  ? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
873
852
  : null;
874
- const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
875
- ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
876
- : null;
877
853
  const hybridPlugin = car.engineData.hybridPlugin;
878
854
 
879
855
  if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
@@ -881,7 +857,6 @@ const getDecoratedProps = (
881
857
  {wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
882
858
  {wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
883
859
  {wrapValue(wltpCo2PluginValue)}
884
- {co2ClassValue && <><br />{co2ClassValue}</>}
885
860
  </React.Fragment>
886
861
  }
887
862
 
@@ -889,7 +864,6 @@ const getDecoratedProps = (
889
864
  return <React.Fragment>
890
865
  {wrapValue(wltpConsumptionCombinedContent)}{', '}
891
866
  {wrapValue(wltpCo2Value)}
892
- {co2ClassValue && <><br />{co2ClassValue}</>}
893
867
  </React.Fragment>
894
868
  }
895
869
 
@@ -899,7 +873,6 @@ const getDecoratedProps = (
899
873
  {consumptionPowerCombined && hybridPlugin ? <br /> : ''}
900
874
  {wrapValue(consumptionCombinedContent)} <br />
901
875
  {wrapValue(co2Value)}
902
- {co2ClassValue && <><br />{co2ClassValue}</>}
903
876
  </React.Fragment>
904
877
  : t('vehicleProps:value.na');
905
878
  }
@@ -38,9 +38,9 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
38
38
  promoSlider: {
39
39
  consumptionCombined: `${vehicleOption.consumptionCombined}l/100km (komb)*`,
40
40
  co2: `${vehicleOption.co2} g CO2/km (komb)*`,
41
- // wltpEnergyEfficiencyClass arrives as `selector_energyEfficiencyClass_X`; map to the bare letter via cbd dict.
42
- co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
43
41
  new: 'neu',
42
+ downPayment: '0€ Anzahlung',
43
+ downPaymentShort: '0€ Anz.',
44
44
  wltpCo2: `${vehicleOption.wltpCo2}g CO2/km (WLTP, komb.)*`,
45
45
  wltpConsumptionCombined: `${vehicleOption.consumptionCombined}l/100km`
46
46
  },
@@ -59,7 +59,6 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
59
59
  deliveryPeriodMonths: `${Math.round(monthsTo)} Monat\nab Bestellung`,
60
60
  deliveryPeriodDays: `${count} Tag\nab Bestellung`,
61
61
  co2Combined: `${vehicleOption.co2}g CO2/km (komb)*`,
62
- co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
63
62
  co2: `${vehicleOption.co2} g/km `,
64
63
  na: 'N/A',
65
64
  priceSub: '/mtl.',
@@ -747,7 +746,9 @@ export const SearchPage = (chip?: any) => {
747
746
  'error': 'Das Angebot konnte nicht zum Hauptschieberegler hinzugefügt werden. Versuchen Sie es später noch einmal.'
748
747
  },
749
748
  'promoSlider': {
750
- 'new': 'neu'
749
+ 'new': 'neu',
750
+ 'downPayment': '0€ Anzahlung',
751
+ 'downPaymentShort': '0€ Anz.'
751
752
  },
752
753
  'rateSearchWidget': {
753
754
  'changeRateLink': 'ändern',
package/.husky/pre-push DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- npm run test:ci
@@ -1,4 +0,0 @@
1
- import '@storybook/addon-actions/register';
2
- import '@storybook/addon-links/register';
3
- import '@storybook/addon-backgrounds/register';
4
- import 'storybook-addon-i18next/register';
@@ -1,64 +0,0 @@
1
- import { configure, addDecorator, addParameters } from '@storybook/react';
2
-
3
- import i18n from 'i18next';
4
- import centered from '@storybook/addon-centered/react';
5
-
6
- import { reactI18nextModule } from 'react-i18next';
7
- import { withI18next } from 'storybook-addon-i18next';
8
- import { en, de } from '@bytebrand/i18n-dictionaries';
9
-
10
- import '!style-loader!css-loader!stylus-loader!../source/theme/colors.styl';
11
-
12
- i18n
13
- .use(reactI18nextModule)
14
- .init({
15
- whitelist: ['en', 'de'],
16
- lng: 'de',
17
- fallbackLng: 'de',
18
- interpolation: {
19
- escapeValue: false,
20
- },
21
- debug: process.env.NODE_ENV === 'development',
22
- react: {
23
- wait: true
24
- },
25
- },
26
- (err, t) => {
27
- if (err) {
28
- return console.error('Something went wrong loading', err);
29
- }
30
-
31
- i18n.addResourceBundle('en', 'cbd', en, true, true);
32
- i18n.addResourceBundle('de', 'cbd', de, true, true);
33
-
34
- });
35
-
36
- addDecorator(withI18next({
37
- i18n,
38
- languages: {
39
- en: 'English',
40
- de: 'Deutsch',
41
- }
42
- }));
43
-
44
- addParameters({
45
- options: {
46
- sortStoriesByKind: true
47
- },
48
- backgrounds: [
49
- { name: 'white', value: '#fff' },
50
- { name: 'grey', value: '#808080', default: true },
51
- { name: 'black', value: '#000' }
52
- ]
53
- });
54
-
55
- addDecorator(centered);
56
-
57
- // automatically import all files ending in *.stories.js
58
- const req = require.context('../source/components', true, /.story.js$/);
59
-
60
- function loadStories() {
61
- req.keys().forEach(filename => req(filename));
62
- }
63
-
64
- configure(loadStories, module);
@@ -1,6 +0,0 @@
1
- module.exports = ({ file, options, env }) => ({
2
- parser: false,
3
- plugins: {
4
- 'autoprefixer': env === 'production' ? options.autoprefixer : false,
5
- }
6
- });
@@ -1,10 +0,0 @@
1
- <link rel="stylesheet" type="text/css" charset="UTF-8"
2
- href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" />
3
- <link rel="stylesheet" type="text/css"
4
- href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" />
5
-
6
- <link rel="stylesheet" type="text/css"
7
- href="https://cdn.jsdelivr.net/npm/react-checkbox-tree@1.5.1/lib/react-checkbox-tree.css" />
8
-
9
- <link rel="stylesheet" type="text/css"
10
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" />
@@ -1,130 +0,0 @@
1
- const path = require('path');
2
- const autoprefixer = require('autoprefixer');
3
-
4
- const babelPlugins = [
5
- [require('@babel/plugin-proposal-decorators').default , { legacy: true }],
6
- require('@babel/plugin-transform-react-constant-elements').default,
7
- require('@babel/plugin-proposal-class-properties').default,
8
- require('babel-plugin-minify-dead-code-elimination'),
9
- require('babel-plugin-transform-imports')
10
- ];
11
-
12
- const presetOptions = {
13
- useBuiltIns: 'usage',
14
- corejs: '2'
15
- };
16
-
17
- const babelPresets = [
18
- [require('@babel/preset-env').default, presetOptions],
19
- require('@babel/preset-react').default,
20
- require('@babel/preset-typescript').default
21
- ];
22
-
23
- const BABEL_LOADER = {
24
- loader: require.resolve('babel-loader'),
25
- options: {
26
- babelrc: false,
27
- cacheDirectory: true,
28
- presets: babelPresets,
29
- plugins: babelPlugins
30
- }
31
- };
32
-
33
- const TSLINT_LOADER = {
34
-
35
- };
36
-
37
- const CSS_LOADER = ({ modules }) => ({
38
- loader: require.resolve('css-loader'),
39
- options: {
40
- modules,
41
- sourceMap: true,
42
- importLoaders: 1,
43
- localsConvention: 'camelCase'
44
- }
45
- });
46
-
47
- const STYLUS_LOADER = {
48
- loader: require.resolve('stylus-loader'),
49
- options: {
50
- sourceMap: 'inline'
51
- }
52
- };
53
-
54
- const POST_CSS_LOADER = {
55
- loader: require.resolve('postcss-loader'),
56
- options: {
57
- sourceMap: 'inline',
58
- ident: 'postcss',
59
- config: {
60
- path: path.join(__dirname, './postcss.config.js')
61
- },
62
- plugins: () => [
63
- autoprefixer({
64
- grid: false
65
- })
66
- ]
67
- }
68
- };
69
-
70
- const STYLE_LOADER = {
71
- loader: require.resolve('style-loader'),
72
- options: {
73
- injectType: 'singletonStyleTag'
74
- }
75
- };
76
-
77
- const buildConfig = async ({ config, mode }) => {
78
- config.module.rules.push({
79
- enforce: 'pre',
80
- test: /\.tsx?$/,
81
- loader: require.resolve('tslint-loader'),
82
- exclude: '/node_modules/',
83
- options: {
84
- emitErrors: true
85
- }
86
- });
87
-
88
- config.module.rules.push({
89
- test: /\.tsx?$/,
90
- exclude: /(node_modules|public)\/(?!@bytebrand).*/,
91
- use: [BABEL_LOADER]
92
- });
93
-
94
- config.module.rules.push({
95
- test: /\.css$/,
96
- use: [
97
- STYLE_LOADER,
98
- CSS_LOADER({ modules: true }),
99
- POST_CSS_LOADER
100
- ]
101
- });
102
-
103
- config.module.rules.push({
104
- test: /\.styl$/,
105
- exclude: /\.global.styl$/,
106
- use: [
107
- STYLE_LOADER,
108
- CSS_LOADER({ modules: true }),
109
- POST_CSS_LOADER,
110
- STYLUS_LOADER
111
- ]
112
- });
113
-
114
- // prepend .global to *.stylus file to import it globally
115
- config.module.rules.push({
116
- test: /\.global.styl$/,
117
- use: [
118
- STYLE_LOADER,
119
- CSS_LOADER({ modules: false }),
120
- POST_CSS_LOADER,
121
- STYLUS_LOADER
122
- ]
123
- });
124
-
125
- config.resolve.extensions.push('.ts', '.tsx', '.styl');
126
-
127
- return config;
128
- };
129
-
130
- module.exports = buildConfig;
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import OrderOverviewItem from '../../../../source/components/Checkout/OrderOverviewItem/OrderOverviewItem';
4
-
5
- describe('OrderOverviewItem', () => {
6
- it('renders the component with the correct data', () => {
7
- const fields = {
8
- title: 'Test Title',
9
- oneLineRate: '10',
10
- additionalTitle: 'Additional Title',
11
- content: [
12
- {
13
- rate: '5',
14
- fieldName: 'Field Name'
15
- }
16
- ],
17
- rate: '15'
18
- };
19
- const activeStep = 1;
20
- const handleClick = jest.fn();
21
- render(
22
- <OrderOverviewItem
23
- fields={fields}
24
- activeStep={activeStep}
25
- handleStep={handleClick}
26
- titleClassName="test-title-class"
27
- fieldClassName="test-field-class"
28
- />
29
- );
30
- // Test that the correct elements are rendered with the correct values
31
- expect(screen.getByText(fields.title)).toBeInTheDocument();
32
- expect(screen.getByText(fields.oneLineRate)).toBeInTheDocument();
33
- expect(screen.getByText(fields.additionalTitle)).toBeInTheDocument();
34
- expect(screen.getByText(fields.content[0].rate)).toBeInTheDocument();
35
- // Test that the correct classes are applied
36
- expect(screen.getByText(fields.title)).toHaveClass('test-title-class');
37
- expect(screen.getByText(fields.oneLineRate)).toHaveClass('test-field-class');
38
- // Test that the edit icon is clickable and calls the handleStep function
39
- expect(screen.getByTestId('editIcon')).toBeInTheDocument();
40
-
41
- });
42
- });