@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
@@ -1,613 +0,0 @@
1
- import React from 'react';
2
- import { fireEvent, render, screen, waitFor } from '@testing-library/react';
3
- import CheckoutSection from '../../../../../source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection';
4
- import { observable } from 'mobx';
5
-
6
- const t = (phrase: string | string[], options: object) => {
7
- if (options) {
8
- const value = Object.values(options).map((option) => option);
9
- return `${phrase} ${value}`;
10
- }
11
- return phrase;
12
- };
13
-
14
- interface IWithRouter {
15
- children?: JSX.Element;
16
- link?: string;
17
- }
18
- const getCheckoutCarListMock = jest.fn();
19
-
20
- const checkoutCars = [
21
- {
22
- parkedFor: 'N/A',
23
- id: '56a33015-04b9-4419-ba0b-95fa52a26b4a',
24
- mainImageId: 'NQjEQK6YUCBX',
25
- imagesCount: 14,
26
- hasInteriorExteriorPhoto: false,
27
- title: {
28
- make: 'Ford',
29
- model: 'Kuga',
30
- subModel: '2.5 Duratec PHEV ST-LINE XNavi * LED * HUD',
31
- option: '',
32
- to: ''
33
- },
34
- showNewLabel: true,
35
- info: {
36
- regDate: 1646089200,
37
- mileage: 19693,
38
- gearbox: 'selector_gearbox_automatic',
39
- numberOfPreviousOwners: 1,
40
- usageType: 'selector_unknown',
41
- condition: 'selector_condition_used',
42
- damaged: false,
43
- driveType: 'selector_unknown'
44
- },
45
- location: {
46
- city: ' ',
47
- street: 'N/A',
48
- zipCode: ' '
49
- },
50
- consumption: {
51
- fuel: 'selector_fuel_hybridElectricalPetrol',
52
- consumptionCombined: 1.4,
53
- consumptionPowerCombined: ' '
54
- },
55
- engineData: {
56
- powerKW: 112,
57
- powerPS: 112
58
- },
59
- environmentEmissions: {
60
- co2: 31
61
- },
62
- offer: {
63
- offerId: ' ',
64
- autoDeOfferId: ' ',
65
- offerFrom: 'selector_unknown',
66
- offerSource: ' ',
67
- offerAvailability: 'selector_unknown',
68
- offerDescription: ' ',
69
- deliveryDate: ' ',
70
- deliveryPeriod: 'selector_deliveryPeriod_days6',
71
- dealerHomepage: ' ',
72
- closedDomain: ' ',
73
- export: ' ',
74
- commercial: ' ',
75
- warranty: ' ',
76
- rentingPossible: ' ',
77
- newHuAu: ' ',
78
- internalNumber: '102469423/4182',
79
- availabilityMode: 'selector_availabilityMode_fromDate',
80
- availabilityFrom: ' ',
81
- mobileDeOfferId: ' ',
82
- as24DeOfferId: ' ',
83
- elnOfferId: 'a0b90f80da6caddd07eb31f9ea1cc162'
84
- },
85
- price: {
86
- offerIndex: 0,
87
- isStrike: false,
88
- comparable: {
89
- annualMileage: 10000,
90
- firstInstallment: ' ',
91
- paybackPeriod: 48,
92
- withAddServices: ' ',
93
- withTransportation: ' '
94
- },
95
- checkout: {
96
- warrantyRates: [
97
- 0,
98
- 0,
99
- 0
100
- ],
101
- warrantyPackage: 0,
102
- warrantyPeriod: 1,
103
- admissionService: 0,
104
- licensePlateFee: 0
105
- },
106
- common: {
107
- firstRegistration: 1646089200,
108
- mileage: 19693,
109
- currentSalesPrice: 44666,
110
- highestPrice: 44666,
111
- isStrikeShown: false,
112
- isHybridOrElectric: true
113
- },
114
- financing: {
115
- grossLoanAmountWithoutFinalInstallment: 0,
116
- purchasePrice: 0,
117
- hasPaymentProtection: false,
118
- paymentProtectionInsurance: 0,
119
- monthlyInstallment: 199,
120
- oldMonthlyInstallment: 199,
121
- annualMileage: 25000,
122
- firstInstallment: 17800,
123
- withTransportation: false,
124
- withAddServices: true,
125
- addServicesCostRaw: 110,
126
- addServicesCost: 110,
127
- transportationCostRaw: 499,
128
- transportationCost: 499,
129
- withFinalInstallment: true,
130
- paybackPeriod: 72,
131
- rawPaybackPeriod: 72,
132
- nominalInterestRate: 3.92,
133
- annualPercentageRate: 6.99,
134
- financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
135
- periodInterestRate: [
136
- {
137
- duration: 12,
138
- recommended: 70,
139
- current: 88,
140
- inEUR: ' ',
141
- value: 26866,
142
- highestValue: 39306.08
143
- },
144
- {
145
- duration: 24,
146
- recommended: 66,
147
- current: 77,
148
- inEUR: ' ',
149
- value: 26866,
150
- highestValue: 34392.82
151
- },
152
- {
153
- duration: 36,
154
- recommended: 60,
155
- current: 66,
156
- inEUR: ' ',
157
- value: 26866,
158
- highestValue: 29479.56
159
- },
160
- {
161
- duration: 48,
162
- recommended: 50,
163
- current: 60,
164
- inEUR: ' ',
165
- value: 26733.6,
166
- highestValue: 26799.6
167
- },
168
- {
169
- duration: 60,
170
- recommended: 40,
171
- current: 50,
172
- inEUR: ' ',
173
- value: 22278,
174
- highestValue: 22333
175
- },
176
- {
177
- duration: 72,
178
- recommended: 30,
179
- current: 40,
180
- inEUR: ' ',
181
- value: 17822.4,
182
- highestValue: 17866.4
183
- },
184
- {
185
- duration: 84,
186
- recommended: 20,
187
- current: 30,
188
- inEUR: ' ',
189
- value: 13366.8,
190
- highestValue: 13399.8
191
- },
192
- {
193
- duration: 96,
194
- recommended: 10,
195
- current: 20,
196
- inEUR: ' ',
197
- value: 8911.2,
198
- highestValue: 8933.2
199
- }
200
- ],
201
- closingCosts: 0,
202
- offersFinancing: true,
203
- rateMode: 'dealer'
204
- },
205
- buy: {
206
- withTransportation: false,
207
- withAddServices: true,
208
- withoutAddServices: true,
209
- transportationCost: 499,
210
- addServicesCost: 799,
211
- currentSalesPriceExtra: 44666,
212
- highestPriceExtra: 44666,
213
- extraCost: 0
214
- },
215
- leasing: {
216
- RWG: 4,
217
- maxAge: 24,
218
- maxMileage: 1000000,
219
- isActive: true,
220
- withTransportation: false,
221
- withAddServices: false,
222
- addServicesCostRaw: 799,
223
- transportationCostRaw: 499,
224
- addServicesCost: 799,
225
- transportationCost: 499,
226
- monthlyAddServices: 0,
227
- monthlyTransportation: 0,
228
- monthlyInstallment: 650,
229
- oldMonthlyInstallment: 650,
230
- firstInstallment: 20,
231
- firstInstallmentMax: 2000,
232
- annualMileage: 10000,
233
- paybackPeriodRange: [
234
- 30,
235
- 36,
236
- 42,
237
- 48,
238
- 54,
239
- 60
240
- ],
241
- paybackPeriod: 48,
242
- santanderPayBackMin: 250,
243
- nominalInterestRate: 6.78,
244
- financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
245
- grossLoanAmountWithoutFinalInstallment: 0,
246
- hasPaymentProtection: false,
247
- paymentProtectionInsurance: 1100,
248
- leasingMode: 'default',
249
- currentSalesPrice: 44666
250
- },
251
- abo: {
252
- paybackPeriod: 6,
253
- annualMileage: 10000
254
- },
255
- firstRegistration: 1646089200,
256
- mileage: 19693,
257
- currentSalesPrice: 44666,
258
- highestPrice: 44666,
259
- isStrikeShown: false,
260
- carId: '56a33015-04b9-4419-ba0b-95fa52a26b4a',
261
- offerName: 'financing',
262
- vehicleId: '56a33015-04b9-4419-ba0b-95fa52a26b4a',
263
- vatRate: 19,
264
- mlCurrentSalesPricePredicted: ' ',
265
- historyPriceDifference: 0,
266
- historyPriceDifferencePerCent: 0,
267
- margin: 10676,
268
- toRound: false
269
- },
270
- internalNumber: '102469423/4182',
271
- vin: ' ',
272
- isOnline: true,
273
- firstIsOnline: 1685705645,
274
- url: '/search/vehicle/56a33015-04b9-4419-ba0b-95fa52a26b4a',
275
- relativeScore: 0,
276
- baseUrl: '',
277
- offerSource: '',
278
- crawledAt: '',
279
- ownerName: 'Guardian of Auto.de',
280
- modificationDate: '02.06.2023',
281
- seoText: ''
282
- },
283
- {
284
- parkedFor: 'N/A',
285
- id: 'ffa641c8-a85f-4d87-9880-b2aa12386520',
286
- mainImageId: '0NNcWdyo6MW4',
287
- imagesCount: 15,
288
- hasInteriorExteriorPhoto: false,
289
- title: {
290
- make: 'Audi',
291
- model: 'A4',
292
- subModel: 'Avant 1.4 TFSI design Virtual Cockpit LED DAB Navi SHZ PDC Klima',
293
- option: '',
294
- to: ''
295
- },
296
- showNewLabel: false,
297
- info: {
298
- regDate: 1525125600,
299
- mileage: 29987,
300
- gearbox: 'selector_gearbox_manualShift',
301
- numberOfPreviousOwners: 2,
302
- usageType: 'selector_unknown',
303
- condition: 'selector_condition_used',
304
- damaged: false,
305
- driveType: 'selector_unknown'
306
- },
307
- location: {
308
- city: ' ',
309
- street: 'N/A',
310
- zipCode: ' '
311
- },
312
- consumption: {
313
- fuel: 'selector_fuel_petrol',
314
- consumptionCombined: 5.6,
315
- consumptionPowerCombined: ' '
316
- },
317
- engineData: {
318
- powerKW: 110,
319
- powerPS: 110
320
- },
321
- environmentEmissions: {
322
- co2: 133
323
- },
324
- offer: {
325
- offerId: ' ',
326
- autoDeOfferId: ' ',
327
- offerFrom: 'selector_unknown',
328
- offerSource: ' ',
329
- offerAvailability: 'selector_unknown',
330
- offerDescription: ' ',
331
- deliveryDate: 1676268549,
332
- deliveryPeriod: 'selector_unknown',
333
- dealerHomepage: ' ',
334
- closedDomain: ' ',
335
- export: ' ',
336
- commercial: ' ',
337
- warranty: ' ',
338
- rentingPossible: ' ',
339
- newHuAu: ' ',
340
- internalNumber: '181212/11921',
341
- availabilityMode: 'selector_availabilityMode_always',
342
- mobileDeOfferId: ' ',
343
- as24DeOfferId: ' ',
344
- elnOfferId: '24198cbd398fdcb14d19b17ec1827c21',
345
- availabilityFrom: 1685532642
346
- },
347
- price: {
348
- offerIndex: 0,
349
- isStrike: false,
350
- comparable: {
351
- annualMileage: 10000,
352
- firstInstallment: ' ',
353
- paybackPeriod: 48,
354
- withAddServices: ' ',
355
- withTransportation: ' '
356
- },
357
- checkout: {
358
- warrantyRates: [
359
- 0,
360
- 0,
361
- 0
362
- ],
363
- warrantyPackage: 0,
364
- warrantyPeriod: 1,
365
- admissionService: 0,
366
- licensePlateFee: 0
367
- },
368
- common: {
369
- firstRegistration: 1525125600,
370
- mileage: 29987,
371
- currentSalesPrice: 32666,
372
- highestPrice: 33666,
373
- isStrikeShown: true,
374
- isHybridOrElectric: false
375
- },
376
- financing: {
377
- grossLoanAmountWithoutFinalInstallment: 0,
378
- purchasePrice: 0,
379
- hasPaymentProtection: false,
380
- paymentProtectionInsurance: 0,
381
- monthlyInstallment: 150,
382
- oldMonthlyInstallment: 161,
383
- annualMileage: 25000,
384
- firstInstallment: 12700,
385
- withTransportation: false,
386
- withAddServices: true,
387
- addServicesCostRaw: 799,
388
- addServicesCost: 799,
389
- transportationCostRaw: 499,
390
- transportationCost: 499,
391
- withFinalInstallment: true,
392
- paybackPeriod: 72,
393
- rawPaybackPeriod: 72,
394
- nominalInterestRate: 3.92,
395
- annualPercentageRate: 6.99,
396
- financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
397
- periodInterestRate: [
398
- {
399
- duration: 12,
400
- recommended: 70,
401
- current: 88,
402
- inEUR: ' ',
403
- value: 19966,
404
- highestValue: 29626.08
405
- },
406
- {
407
- duration: 24,
408
- recommended: 66,
409
- current: 77,
410
- inEUR: ' ',
411
- value: 19966,
412
- highestValue: 25922.82
413
- },
414
- {
415
- duration: 36,
416
- recommended: 60,
417
- current: 66,
418
- inEUR: ' ',
419
- value: 19966,
420
- highestValue: 22219.56
421
- },
422
- {
423
- duration: 48,
424
- recommended: 50,
425
- current: 60,
426
- inEUR: ' ',
427
- value: 19120.2,
428
- highestValue: 20199.6
429
- },
430
- {
431
- duration: 60,
432
- recommended: 40,
433
- current: 50,
434
- inEUR: ' ',
435
- value: 15933.5,
436
- highestValue: 16833
437
- },
438
- {
439
- duration: 72,
440
- recommended: 30,
441
- current: 40,
442
- inEUR: ' ',
443
- value: 12746.8,
444
- highestValue: 13466.4
445
- },
446
- {
447
- duration: 84,
448
- recommended: 20,
449
- current: 30,
450
- inEUR: ' ',
451
- value: 9560.1,
452
- highestValue: 10099.8
453
- },
454
- {
455
- duration: 96,
456
- recommended: 10,
457
- current: 20,
458
- inEUR: ' ',
459
- value: 6373.4,
460
- highestValue: 6733.2
461
- }
462
- ],
463
- closingCosts: 0,
464
- offersFinancing: true,
465
- rateMode: 'dealer'
466
- },
467
- buy: {
468
- withTransportation: false,
469
- withAddServices: true,
470
- withoutAddServices: true,
471
- transportationCost: 499,
472
- addServicesCost: 799,
473
- currentSalesPriceExtra: 32666,
474
- highestPriceExtra: 33666,
475
- extraCost: 0
476
- },
477
- leasing: {
478
- RWG: 4,
479
- maxAge: 24,
480
- maxMileage: 1000000,
481
- isActive: true,
482
- withTransportation: false,
483
- withAddServices: false,
484
- addServicesCostRaw: 799,
485
- transportationCostRaw: 499,
486
- addServicesCost: 799,
487
- transportationCost: 499,
488
- monthlyAddServices: 0,
489
- monthlyTransportation: 0,
490
- monthlyInstallment: 472,
491
- oldMonthlyInstallment: 487,
492
- firstInstallment: 20,
493
- firstInstallmentMax: 2000,
494
- annualMileage: 10000,
495
- paybackPeriodRange: [
496
- 30,
497
- 36,
498
- 42,
499
- 48,
500
- 54,
501
- 60
502
- ],
503
- paybackPeriod: 48,
504
- santanderPayBackMin: 250,
505
- nominalInterestRate: 6.78,
506
- financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
507
- grossLoanAmountWithoutFinalInstallment: 0,
508
- hasPaymentProtection: false,
509
- paymentProtectionInsurance: 1100,
510
- leasingMode: 'default',
511
- currentSalesPrice: 32666
512
- },
513
- abo: {
514
- paybackPeriod: 6,
515
- annualMileage: 10000
516
- },
517
- firstRegistration: 1525125600,
518
- mileage: 29987,
519
- currentSalesPrice: 32666,
520
- highestPrice: 33666,
521
- isStrikeShown: true,
522
- carId: 'ffa641c8-a85f-4d87-9880-b2aa12386520',
523
- offerName: 'financing',
524
- vehicleId: 'ffa641c8-a85f-4d87-9880-b2aa12386520',
525
- vatRate: 19,
526
- mlCurrentSalesPricePredicted: ' ',
527
- historyPriceDifference: 1000,
528
- historyPriceDifferencePerCent: 3,
529
- margin: 32666,
530
- toRound: false
531
- },
532
- internalNumber: '181212/11921',
533
- vin: ' ',
534
- isOnline: true,
535
- firstIsOnline: 1675669977,
536
- url: '/search/vehicle/ffa641c8-a85f-4d87-9880-b2aa12386520',
537
- relativeScore: 0,
538
- baseUrl: '',
539
- offerSource: '',
540
- crawledAt: '',
541
- ownerName: 'Guardian of Auto.de',
542
- modificationDate: '24.05.2023',
543
- seoText: ''
544
- }
545
- ];
546
- const getCheckoutCarList = () => {
547
- return new Promise((resolve) => {
548
- resolve(checkoutCars);
549
- });
550
- };
551
-
552
- const LinkRouter = ({ children, link }: IWithRouter) => {
553
- return (
554
- <a href={link} >
555
- {children}
556
- </a>
557
- );
558
- };
559
-
560
- const aggStatsData = observable({
561
- '56a33015-04b9-4419-ba0b-95fa52a26b4a': {
562
- carId: '56a33015-04b9-4419-ba0b-95fa52a26b4a',
563
- totalFavCount: 3,
564
- totalCarImpCount: 7399,
565
- slidingCarImpCount: 10
566
- },
567
- get() {
568
- return {
569
- 'b359d74f-bb96-4fca-9539-579792fe7c36': {
570
- carId: '56a33015-04b9-4419-ba0b-95fa52a26b4a',
571
- totalFavCount: 3,
572
- totalCarImpCount: 7399,
573
- slidingCarImpCount: 10
574
- }
575
- };
576
- }
577
- });
578
- const mockProps = {
579
- t,
580
- LinkRouter,
581
- checkoutCars,
582
- PLACEHOLDER_IMAGE_SMALL_URL: 'PLACEHOLDER_IMAGE_SMALL_URL',
583
- appStore: { language:'en' },
584
- carsStore: { aggStatsData },
585
- imagesStore: { getSupportedImageFormat: jest.fn() },
586
- checkoutStore:{ checkoutCars, getCheckoutCarList:getCheckoutCarListMock }
587
- };
588
-
589
- describe('CheckoutSection', () => {
590
- it('renders correctly', () => {
591
- const { container } = render(<CheckoutSection {...mockProps as any} />);
592
- // expect(mockProps.checkoutStore.getCheckoutCarList).toHaveBeenCalledTimes(1);
593
- expect(container).toBeInTheDocument();
594
- });
595
- it('should display correct car data', () => {
596
- const { container } = render(<CheckoutSection {...mockProps as any} />);
597
- mockProps.checkoutCars.forEach((element:any) => {
598
- expect(container).toHaveTextContent(element.title.make);
599
- });
600
- // });
601
- });
602
- it('should open checkout page with correct URL on car select', () => {
603
- const { getAllByRole } = render(<CheckoutSection {...mockProps as any} />);
604
- // mockProps.checkoutStore.getCheckoutCarList()
605
- // .then((savedCheckoutDataList: any) => {
606
- const checkoutButton = getAllByRole('link')[0];
607
- fireEvent.click(checkoutButton);
608
- const expectedUrl = `/checkout/contact-information?carId=${mockProps.checkoutCars[0].id}&isSavedCheckout=true&mainImageId=${mockProps.checkoutCars[0].mainImageId}&model=${mockProps.checkoutCars[0].title.model}&subModel=${mockProps.checkoutCars[0].title.subModel}&make=${mockProps.checkoutCars[0].title.make}`;
609
- waitFor(() => expect(window.open).toHaveBeenCalledWith(expectedUrl, '_blank'));
610
- // });
611
- });
612
-
613
- });