@bytebrand/fe-ui-core 4.3.0 → 4.4.0
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.
- package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
- package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
- package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +4 -2
- package/common.ts +6 -2
- package/package.json +19 -28
- package/source/components/AccordionWidget/AccordionWidget.tsx +1 -3
- package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +2 -190
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +15 -16
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
- package/source/components/FormattedNumber/FormattedNumber.tsx +2 -3
- package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +4 -6
- package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +0 -3
- package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.js → MuiOfferPeriod.theme.tsx} +8 -13
- package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +28 -4
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +6 -12
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +0 -4
- package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +6 -4
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +6 -2
- package/source/components/SearchFilters/filters/AlternativeID.tsx +42 -53
- package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
- package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
- package/source/components/SearchFilters/filters/FirstRegistration.tsx +0 -1
- package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
- package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -1
- package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
- package/source/components/SearchFilters/filters/Power.tsx +36 -17
- package/source/components/SearchFilters/filters/StateOptions.tsx +0 -1
- package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
- package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
- package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
- package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
- package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
- package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
- package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
- package/source/components/SearchWidget/StateWidget/StateWidget.tsx +1 -2
- package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
- package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
- package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
- package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
- package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
- package/source/components/Stepper/Stepper.tsx +4 -3
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +38 -0
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +120 -0
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +22 -0
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +84 -0
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +11 -2
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +57 -38
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +183 -101
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +5 -7
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +33 -7
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +10 -2
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +54 -14
- package/source/components/VehicleDetailedSidebar/partials/Price.styl +5 -1
- package/source/components/VehicleDetailedSidebar/partials/Price.tsx +2 -1
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +16 -5
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +9 -4
- package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +45 -0
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +121 -42
- package/source/components/VehicleDetailedSlider/partials/PriceData.styl +4 -1
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +8 -1
- package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +9 -7
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +35 -1
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +9 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +11 -2
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +2 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.styl +3 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -7
- package/source/components/_common/Badge/Badge.styl +3 -0
- package/source/components/_common/Badge/Badge.tsx +1 -1
- package/source/components/_common/Button/Button.tsx +5 -4
- package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
- package/source/components/_common/Chip/Chip.tsx +1 -3
- package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
- package/source/components/_common/IconSVG/IconSVGConfig.tsx +2 -0
- package/source/components/_common/IconSVG/SVG/flags/SK.tsx +0 -1
- package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
- package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +26 -0
- package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +22 -30
- package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +0 -1
- package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +12 -15
- package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
- package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +3 -1
- package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
- package/source/components/_common/Modal/CookieModal.tsx +1 -3
- package/source/components/_common/Modal/Modal.styled.tsx +2 -1
- package/source/components/_common/Modal/Modal.tsx +1 -5
- package/source/components/_common/Modal/ModalsConfig.tsx +5 -1
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +23 -7
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +84 -36
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +29 -14
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +17 -10
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +12 -4
- package/source/components/_common/Range/Range.tsx +27 -14
- package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +0 -1
- package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
- package/source/components/_common/UserMenu/MaterialMenuItem.tsx +42 -20
- package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
- package/source/components/_common/withStats/withStats.styl +3 -0
- package/source/components/_common/withStats/withStats.tsx +19 -16
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +14 -1
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +78 -42
- package/source/framework/constants/common.ts +89 -60
- package/source/framework/constants/highlights.ts +1 -1
- package/source/framework/constants.ts +1 -1
- package/source/framework/types/types.ts +9 -4
- package/source/framework/utils/CommonUtils.ts +73 -62
- package/source/framework/utils/DateUtils.ts +10 -2
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +1 -2
- package/source/framework/vehiclesProps/decoratedProps.tsx +1 -2
- package/source/locales/data.ts +2 -2
- package/tslint.json +1 -2
- package/utils.ts +2 -0
package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import FavoriteSection from '../../../../../source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection';
|
|
4
|
+
import { observable } from 'mobx';
|
|
5
|
+
import qs from 'qs';
|
|
6
|
+
|
|
7
|
+
const t = (phrase: string | string[], options: object) => {
|
|
8
|
+
if (options) {
|
|
9
|
+
const value = Object.values(options).map((option) => option);
|
|
10
|
+
return `${phrase} ${value}`;
|
|
11
|
+
}
|
|
12
|
+
return phrase;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
interface IWithRouter {
|
|
16
|
+
children?: JSX.Element;
|
|
17
|
+
link?: string;
|
|
18
|
+
}
|
|
19
|
+
const LinkRouter = ({ children, link }: IWithRouter) => {
|
|
20
|
+
return (
|
|
21
|
+
<a href={link} >
|
|
22
|
+
{children}
|
|
23
|
+
</a>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
const favoriteCars = [
|
|
27
|
+
{
|
|
28
|
+
parkedFor: 'N/A',
|
|
29
|
+
id: 'c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
30
|
+
mainImageId: ' ',
|
|
31
|
+
imagesCount: ' ',
|
|
32
|
+
hasInteriorExteriorPhoto: ' ',
|
|
33
|
+
title: {
|
|
34
|
+
make: 'Volkswagen',
|
|
35
|
+
model: 'Polo',
|
|
36
|
+
subModel: '1.0 TSI Style',
|
|
37
|
+
option: '',
|
|
38
|
+
to: ''
|
|
39
|
+
},
|
|
40
|
+
showNewLabel: false,
|
|
41
|
+
info: {
|
|
42
|
+
regDate: ' ',
|
|
43
|
+
mileage: 0,
|
|
44
|
+
gearbox: 'selector_gearbox_manualShift',
|
|
45
|
+
numberOfPreviousOwners: 0,
|
|
46
|
+
usageType: 'selector_unknown',
|
|
47
|
+
condition: 'selector_condition_new',
|
|
48
|
+
damaged: false,
|
|
49
|
+
driveType: 'selector_driveType_frontWheelDrive'
|
|
50
|
+
},
|
|
51
|
+
location: {
|
|
52
|
+
city: 't',
|
|
53
|
+
street: 't',
|
|
54
|
+
zipCode: 12345
|
|
55
|
+
},
|
|
56
|
+
consumption: {
|
|
57
|
+
fuel: 'selector_fuel_petrol',
|
|
58
|
+
consumptionCombined: 5.2,
|
|
59
|
+
consumptionPowerCombined: ' '
|
|
60
|
+
},
|
|
61
|
+
engineData: {
|
|
62
|
+
powerKW: 70,
|
|
63
|
+
powerPS: 70
|
|
64
|
+
},
|
|
65
|
+
environmentEmissions: {
|
|
66
|
+
co2: 118
|
|
67
|
+
},
|
|
68
|
+
offer: {
|
|
69
|
+
offerId: ' ',
|
|
70
|
+
autoDeOfferId: ' ',
|
|
71
|
+
offerFrom: 'selector_unknown',
|
|
72
|
+
offerSource: ' ',
|
|
73
|
+
offerAvailability: 'selector_unknown',
|
|
74
|
+
offerDescription: '',
|
|
75
|
+
deliveryDate: 1698969600,
|
|
76
|
+
deliveryPeriod: 'selector_deliveryPeriod_days270',
|
|
77
|
+
dealerHomepage: ' ',
|
|
78
|
+
closedDomain: ' ',
|
|
79
|
+
export: ' ',
|
|
80
|
+
commercial: ' ',
|
|
81
|
+
warranty: false,
|
|
82
|
+
rentingPossible: ' ',
|
|
83
|
+
newHuAu: true,
|
|
84
|
+
internalNumber: '118_92436S/3243',
|
|
85
|
+
availabilityMode: 'selector_availabilityMode_fromDate',
|
|
86
|
+
mobileDeOfferId: ' ',
|
|
87
|
+
as24DeOfferId: ' ',
|
|
88
|
+
elnOfferId: 'bd11b00a8d643e16b69c308360e5236b'
|
|
89
|
+
},
|
|
90
|
+
price: {
|
|
91
|
+
offerIndex: 0,
|
|
92
|
+
isStrike: false,
|
|
93
|
+
comparable: {
|
|
94
|
+
annualMileage: 10000,
|
|
95
|
+
firstInstallment: ' ',
|
|
96
|
+
paybackPeriod: 48,
|
|
97
|
+
withAddServices: ' ',
|
|
98
|
+
withTransportation: ' '
|
|
99
|
+
},
|
|
100
|
+
checkout: {
|
|
101
|
+
warrantyRates: [
|
|
102
|
+
0,
|
|
103
|
+
0,
|
|
104
|
+
0
|
|
105
|
+
],
|
|
106
|
+
warrantyPackage: 0,
|
|
107
|
+
warrantyPeriod: 1,
|
|
108
|
+
admissionService: 0,
|
|
109
|
+
licensePlateFee: 0
|
|
110
|
+
},
|
|
111
|
+
common: {
|
|
112
|
+
firstRegistration: ' ',
|
|
113
|
+
mileage: 0,
|
|
114
|
+
currentSalesPrice: 30666,
|
|
115
|
+
highestPrice: 34232,
|
|
116
|
+
isStrikeShown: true,
|
|
117
|
+
isHybridOrElectric: false
|
|
118
|
+
},
|
|
119
|
+
financing: {
|
|
120
|
+
grossLoanAmountWithoutFinalInstallment: 0,
|
|
121
|
+
purchasePrice: 0,
|
|
122
|
+
hasPaymentProtection: false,
|
|
123
|
+
paymentProtectionInsurance: 0,
|
|
124
|
+
monthlyInstallment: 142,
|
|
125
|
+
oldMonthlyInstallment: 180,
|
|
126
|
+
annualMileage: 25000,
|
|
127
|
+
firstInstallment: 11900,
|
|
128
|
+
withTransportation: false,
|
|
129
|
+
withAddServices: true,
|
|
130
|
+
addServicesCostRaw: 799,
|
|
131
|
+
addServicesCost: 799,
|
|
132
|
+
transportationCostRaw: 499,
|
|
133
|
+
transportationCost: 499,
|
|
134
|
+
withFinalInstallment: true,
|
|
135
|
+
paybackPeriod: 72,
|
|
136
|
+
rawPaybackPeriod: 72,
|
|
137
|
+
nominalInterestRate: 3.92,
|
|
138
|
+
annualPercentageRate: 6.99,
|
|
139
|
+
financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
|
|
140
|
+
periodInterestRate: [
|
|
141
|
+
{
|
|
142
|
+
duration: 12,
|
|
143
|
+
recommended: 70,
|
|
144
|
+
current: 88,
|
|
145
|
+
inEUR: ' ',
|
|
146
|
+
value: 18766,
|
|
147
|
+
highestValue: 30124.16
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
duration: 24,
|
|
151
|
+
recommended: 66,
|
|
152
|
+
current: 77,
|
|
153
|
+
inEUR: ' ',
|
|
154
|
+
value: 18766,
|
|
155
|
+
highestValue: 26358.64
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
duration: 36,
|
|
159
|
+
recommended: 60,
|
|
160
|
+
current: 66,
|
|
161
|
+
inEUR: ' ',
|
|
162
|
+
value: 18766,
|
|
163
|
+
highestValue: 22593.12
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
duration: 48,
|
|
167
|
+
recommended: 50,
|
|
168
|
+
current: 60,
|
|
169
|
+
inEUR: ' ',
|
|
170
|
+
value: 17920.2,
|
|
171
|
+
highestValue: 20539.2
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
duration: 60,
|
|
175
|
+
recommended: 40,
|
|
176
|
+
current: 50,
|
|
177
|
+
inEUR: ' ',
|
|
178
|
+
value: 14933.5,
|
|
179
|
+
highestValue: 17116
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
duration: 72,
|
|
183
|
+
recommended: 30,
|
|
184
|
+
current: 40,
|
|
185
|
+
inEUR: ' ',
|
|
186
|
+
value: 11946.8,
|
|
187
|
+
highestValue: 13692.8
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
duration: 84,
|
|
191
|
+
recommended: 20,
|
|
192
|
+
current: 30,
|
|
193
|
+
inEUR: ' ',
|
|
194
|
+
value: 8960.1,
|
|
195
|
+
highestValue: 10269.6
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
duration: 96,
|
|
199
|
+
recommended: 10,
|
|
200
|
+
current: 20,
|
|
201
|
+
inEUR: ' ',
|
|
202
|
+
value: 5973.4,
|
|
203
|
+
highestValue: 6846.4
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
closingCosts: 0,
|
|
207
|
+
offersFinancing: true,
|
|
208
|
+
rateMode: 'dealer'
|
|
209
|
+
},
|
|
210
|
+
buy: {
|
|
211
|
+
withTransportation: false,
|
|
212
|
+
withAddServices: true,
|
|
213
|
+
withoutAddServices: true,
|
|
214
|
+
transportationCost: 499,
|
|
215
|
+
addServicesCost: 799,
|
|
216
|
+
currentSalesPriceExtra: 30666,
|
|
217
|
+
highestPriceExtra: 34232,
|
|
218
|
+
extraCost: 0
|
|
219
|
+
},
|
|
220
|
+
leasing: {
|
|
221
|
+
RWG: 7,
|
|
222
|
+
maxAge: 24,
|
|
223
|
+
maxMileage: 1000000,
|
|
224
|
+
isActive: true,
|
|
225
|
+
withTransportation: false,
|
|
226
|
+
withAddServices: false,
|
|
227
|
+
addServicesCostRaw: 799,
|
|
228
|
+
transportationCostRaw: 499,
|
|
229
|
+
addServicesCost: 799,
|
|
230
|
+
transportationCost: 499,
|
|
231
|
+
monthlyAddServices: 0,
|
|
232
|
+
monthlyTransportation: 0,
|
|
233
|
+
monthlyInstallment: 441,
|
|
234
|
+
oldMonthlyInstallment: 526,
|
|
235
|
+
firstInstallment: 20,
|
|
236
|
+
firstInstallmentMax: 2000,
|
|
237
|
+
annualMileage: 10000,
|
|
238
|
+
paybackPeriodRange: [
|
|
239
|
+
30,
|
|
240
|
+
36,
|
|
241
|
+
42,
|
|
242
|
+
48,
|
|
243
|
+
54,
|
|
244
|
+
60
|
|
245
|
+
],
|
|
246
|
+
paybackPeriod: 48,
|
|
247
|
+
santanderPayBackMin: 250,
|
|
248
|
+
nominalInterestRate: 6.78,
|
|
249
|
+
financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
|
|
250
|
+
grossLoanAmountWithoutFinalInstallment: 0,
|
|
251
|
+
hasPaymentProtection: false,
|
|
252
|
+
paymentProtectionInsurance: 1100,
|
|
253
|
+
leasingMode: 'default',
|
|
254
|
+
currentSalesPrice: 30666
|
|
255
|
+
},
|
|
256
|
+
abo: {
|
|
257
|
+
paybackPeriod: 6,
|
|
258
|
+
annualMileage: 10000
|
|
259
|
+
},
|
|
260
|
+
firstRegistration: ' ',
|
|
261
|
+
mileage: 0,
|
|
262
|
+
currentSalesPrice: 30666,
|
|
263
|
+
highestPrice: 34232,
|
|
264
|
+
isStrikeShown: true,
|
|
265
|
+
carId: 'c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
266
|
+
offerName: 'financing',
|
|
267
|
+
vehicleId: 'c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
268
|
+
vatRate: 19,
|
|
269
|
+
mlCurrentSalesPricePredicted: ' ',
|
|
270
|
+
historyPriceDifference: 3566,
|
|
271
|
+
historyPriceDifferencePerCent: 10,
|
|
272
|
+
margin: 30666,
|
|
273
|
+
toRound: false
|
|
274
|
+
},
|
|
275
|
+
internalNumber: '118_92436S/3243',
|
|
276
|
+
vin: '',
|
|
277
|
+
isOnline: true,
|
|
278
|
+
firstIsOnline: 1675668230,
|
|
279
|
+
url: '/search/vehicle/c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
280
|
+
relativeScore: 0,
|
|
281
|
+
baseUrl: '',
|
|
282
|
+
offerSource: '',
|
|
283
|
+
crawledAt: '',
|
|
284
|
+
ownerName: 'Guardian of Auto.de',
|
|
285
|
+
modificationDate: '18.05.2023',
|
|
286
|
+
seoText: ''
|
|
287
|
+
}
|
|
288
|
+
];
|
|
289
|
+
const favoritesIDs = [
|
|
290
|
+
'b359d74f-bb96-4fca-9539-579792fe7c36'
|
|
291
|
+
];
|
|
292
|
+
const getFavoriteCarsMock = jest.fn();
|
|
293
|
+
|
|
294
|
+
const aggStatsData = observable({
|
|
295
|
+
'b359d74f-bb96-4fca-9539-579792fe7c36': {
|
|
296
|
+
carId: 'b359d74f-bb96-4fca-9539-579792fe7c36',
|
|
297
|
+
totalFavCount: 3,
|
|
298
|
+
totalCarImpCount: 7399,
|
|
299
|
+
slidingCarImpCount: 10
|
|
300
|
+
},
|
|
301
|
+
get() {
|
|
302
|
+
return {
|
|
303
|
+
'b359d74f-bb96-4fca-9539-579792fe7c36': {
|
|
304
|
+
carId: 'b359d74f-bb96-4fca-9539-579792fe7c36',
|
|
305
|
+
totalFavCount: 3,
|
|
306
|
+
totalCarImpCount: 7399,
|
|
307
|
+
slidingCarImpCount: 10
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
const mockProps = {
|
|
313
|
+
t,
|
|
314
|
+
LinkRouter,
|
|
315
|
+
favoriteCars,
|
|
316
|
+
PLACEHOLDER_IMAGE_SMALL_URL: 'PLACEHOLDER_IMAGE_SMALL_URL',
|
|
317
|
+
favoriteStore: { favoriteCars, favoritesIDs, showList: true, getFavouriteCars: getFavoriteCarsMock, getFavoritesIDs: jest.fn() },
|
|
318
|
+
appStore: {},
|
|
319
|
+
carsStore: { aggStatsData, getAggStatsData: jest.fn() },
|
|
320
|
+
imagesStore: { getSupportedImageFormat: jest.fn() }
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
describe('FavoriteSection', () => {
|
|
324
|
+
test('calls getFavouriteCars when component is mounted', () => {
|
|
325
|
+
const { container } = render(<FavoriteSection {...mockProps as any} />);
|
|
326
|
+
expect(container).toBeInTheDocument();
|
|
327
|
+
// expect(mockProps.favoriteStore.getFavouriteCars).toHaveBeenCalledTimes(1);
|
|
328
|
+
});
|
|
329
|
+
test('should display correct car data', () => {
|
|
330
|
+
const { container } = render(<FavoriteSection {...mockProps as any} />);
|
|
331
|
+
mockProps.favoriteCars.forEach((element:any) => {
|
|
332
|
+
expect(container).toHaveTextContent(element.title.make);
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
});
|
|
@@ -10,7 +10,8 @@ const expectedResultCDP = [
|
|
|
10
10
|
max: 21666,
|
|
11
11
|
value: 16100,
|
|
12
12
|
unitName: 'modals:financing.euro',
|
|
13
|
-
caption: 'modals:financing.firstInstallment'
|
|
13
|
+
caption: 'modals:financing.firstInstallment',
|
|
14
|
+
withRangeLimit: true
|
|
14
15
|
},
|
|
15
16
|
{
|
|
16
17
|
name: 'annualMileage',
|
|
@@ -33,7 +34,8 @@ const expectedResultCheckout = [
|
|
|
33
34
|
max: 21666,
|
|
34
35
|
value: 16100,
|
|
35
36
|
unitName: 'modals:financing.euro',
|
|
36
|
-
caption: 'modals:financing.firstInstallment'
|
|
37
|
+
caption: 'modals:financing.firstInstallment',
|
|
38
|
+
withRangeLimit: true
|
|
37
39
|
}
|
|
38
40
|
]
|
|
39
41
|
|
package/common.ts
CHANGED
|
@@ -136,7 +136,9 @@ import {
|
|
|
136
136
|
StepButton,
|
|
137
137
|
Accordion as MIAccordion,
|
|
138
138
|
AccordionSummary,
|
|
139
|
-
AccordionDetails
|
|
139
|
+
AccordionDetails,
|
|
140
|
+
ListItemButton,
|
|
141
|
+
RadioGroup as MUIRadioGroup
|
|
140
142
|
} from '@mui/material';
|
|
141
143
|
import { createTheme } from '@mui/material/styles';
|
|
142
144
|
|
|
@@ -156,5 +158,7 @@ export {
|
|
|
156
158
|
MIAccordion,
|
|
157
159
|
AccordionSummary,
|
|
158
160
|
AccordionDetails,
|
|
159
|
-
StyledComponent
|
|
161
|
+
StyledComponent,
|
|
162
|
+
ListItemButton,
|
|
163
|
+
MUIRadioGroup
|
|
160
164
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/fe-ui-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "UI components for the auto.de project",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"module": "dist/common.js",
|
|
@@ -9,46 +9,25 @@
|
|
|
9
9
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
10
10
|
"@babel/plugin-proposal-decorators": "^7.17.8",
|
|
11
11
|
"@babel/plugin-transform-react-constant-elements": "^7.17.6",
|
|
12
|
-
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
13
12
|
"@babel/preset-env": "^7.20.2",
|
|
14
13
|
"@babel/preset-react": "^7.18.6",
|
|
15
14
|
"@babel/preset-typescript": "^7.21.0",
|
|
16
15
|
"@bytebrand/car-schema-selectors": "^2.0.7",
|
|
17
|
-
"@bytebrand/fe-histoslider": "
|
|
16
|
+
"@bytebrand/fe-histoslider": "3.0.0",
|
|
18
17
|
"@bytebrand/i18n-dictionaries": "^0.7.5",
|
|
19
|
-
"@date-io/date-fns": "1.3.13",
|
|
20
18
|
"@emotion/react": "^11.9.3",
|
|
21
19
|
"@emotion/styled": "^11.9.3",
|
|
22
|
-
"@mui/lab": "^5.0.0-alpha.90",
|
|
23
20
|
"@mui/material": "^5.9.0",
|
|
24
21
|
"@mui/styles": "^5.9.0",
|
|
25
22
|
"@mui/x-date-pickers": "^5.0.0-beta.1",
|
|
26
|
-
"@testing-library/dom": "^9.0.1",
|
|
27
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
28
|
-
"@testing-library/react": "^11.2.6",
|
|
29
|
-
"@types/jest": "^29.4.0",
|
|
30
|
-
"@types/js-cookie": "^2.1.0",
|
|
31
|
-
"@types/uuid": "^8.3.1",
|
|
32
|
-
"axios": "^0.24.0",
|
|
33
|
-
"babel-jest": "^26.0.0",
|
|
34
23
|
"classnames": "2.2.6",
|
|
35
|
-
"
|
|
36
|
-
"d3-
|
|
37
|
-
"d3-format": "^1.3.2",
|
|
38
|
-
"d3-scale": "^2.1.0",
|
|
24
|
+
"d3-format": "1.4.5",
|
|
25
|
+
"d3-scale": "^2.2.2",
|
|
39
26
|
"date-fns": "2.29.1",
|
|
40
27
|
"i18next": "^15.0.4",
|
|
41
28
|
"jest": "^26.0.0",
|
|
42
|
-
"jest-css-modules": "^2.1.0",
|
|
43
|
-
"jest-css-modules-transform": "^4.4.2",
|
|
44
|
-
"jest-dom": "^4.0.0",
|
|
45
|
-
"jest-environment-jsdom-sixteen": "^2.0.0",
|
|
46
|
-
"jest-stylus": "^0.1.2",
|
|
47
|
-
"jest-svg-transformer": "^1.0.0",
|
|
48
|
-
"jest-transform-stub": "^2.0.0",
|
|
49
29
|
"js-cookie": "^2.2.0",
|
|
50
30
|
"moment": "^2.29.1",
|
|
51
|
-
"moment-range": "^4.0.2",
|
|
52
31
|
"rc-slider": "^8.6.13",
|
|
53
32
|
"react": "^17.0.2",
|
|
54
33
|
"react-device-detect": "^2.1.2",
|
|
@@ -59,10 +38,7 @@
|
|
|
59
38
|
"react-scroll": "^1.7.13",
|
|
60
39
|
"react-select": "^3.0.4",
|
|
61
40
|
"react-slick": "^0.29.0",
|
|
62
|
-
"react-test-renderer": "^18.2.0",
|
|
63
|
-
"react-testing-library": "^8.0.1",
|
|
64
41
|
"slick-carousel": "1.8.1",
|
|
65
|
-
"ts-jest": "^26.0.0",
|
|
66
42
|
"uuid": "^8.3.2"
|
|
67
43
|
},
|
|
68
44
|
"devDependencies": {
|
|
@@ -73,23 +49,37 @@
|
|
|
73
49
|
"@storybook/addon-links": "^5.1.11",
|
|
74
50
|
"@storybook/addons": "^5.1.11",
|
|
75
51
|
"@storybook/react": "^5.3.21",
|
|
52
|
+
"@testing-library/dom": "^9.0.1",
|
|
53
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
54
|
+
"@testing-library/react": "^11.2.6",
|
|
76
55
|
"@types/classnames": "2.2.6",
|
|
77
56
|
"@types/d3-format": "^1.3.1",
|
|
78
57
|
"@types/i18next": "^12.1.0",
|
|
58
|
+
"@types/jest": "^29.4.0",
|
|
59
|
+
"@types/js-cookie": "^2.1.0",
|
|
79
60
|
"@types/lodash": "^4.14.134",
|
|
80
61
|
"@types/qs": "^6.9.7",
|
|
81
62
|
"@types/rc-slider": "^9.3.1",
|
|
82
63
|
"@types/react": "^17.0.2",
|
|
83
64
|
"@types/react-dom": "^17.0.2",
|
|
84
65
|
"@types/react-lazyload": "^2.5.0",
|
|
66
|
+
"@types/react-scroll": "^1.8.7",
|
|
85
67
|
"@types/react-select": "^3.0.2",
|
|
86
68
|
"@types/react-slick": "^0.23.4 ",
|
|
69
|
+
"@types/uuid": "^8.3.1",
|
|
87
70
|
"autoprefixer": "^9.6.0",
|
|
88
71
|
"babel-loader": "^8.0.6",
|
|
89
72
|
"babel-plugin-minify-dead-code-elimination": "^0.5.0",
|
|
90
73
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
91
74
|
"css-loader": "^3.2.0",
|
|
75
|
+
"jest-css-modules": "^2.1.0",
|
|
76
|
+
"jest-css-modules-transform": "^4.4.2",
|
|
77
|
+
"jest-dom": "^4.0.0",
|
|
78
|
+
"jest-environment-jsdom-sixteen": "^2.0.0",
|
|
92
79
|
"jest-junit": "^15.0.0",
|
|
80
|
+
"jest-stylus": "^0.1.2",
|
|
81
|
+
"jest-svg-transformer": "^1.0.0",
|
|
82
|
+
"jest-transform-stub": "^2.0.0",
|
|
93
83
|
"lodash": "^4.17.15",
|
|
94
84
|
"mobx": "4.6.0",
|
|
95
85
|
"mobx-react": "5.4.3",
|
|
@@ -102,6 +92,7 @@
|
|
|
102
92
|
"style-loader": "^1.0.0",
|
|
103
93
|
"stylus": "^0.54.5",
|
|
104
94
|
"stylus-loader": "^3.0.2",
|
|
95
|
+
"ts-jest": "^26.0.0",
|
|
105
96
|
"tslint": "^5.17.0",
|
|
106
97
|
"tslint-config-airbnb": "^5.11.1",
|
|
107
98
|
"tslint-loader": "^3.5.4",
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
|
|
16
16
|
import ExpansionPanel from '../_common/ExpansionPanel/ExpansionPanel';
|
|
17
17
|
import Accordion from '../_common/AccordionWrapper/AccordionWrapper';
|
|
18
|
-
// import AccordionItem from '../_common/AccordionWrapper/AccordionItem/AccordionItem';
|
|
19
18
|
import VehicleProperty from '../VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty';
|
|
20
19
|
import IconSVG from '../_common/IconSVG/IconSVG';
|
|
21
20
|
import { getActualHighlights } from '../../framework/constants/highlights';
|
|
@@ -35,7 +34,7 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
handleChange =
|
|
38
|
-
(panel: string) => (
|
|
37
|
+
(panel: string) => (_: React.SyntheticEvent, isExpanded: boolean) => {
|
|
39
38
|
this.setState({ expanded: isExpanded ? panel : false });
|
|
40
39
|
};
|
|
41
40
|
|
|
@@ -210,7 +209,6 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
|
|
|
210
209
|
onChange={this.handleChange}
|
|
211
210
|
expanded={this.state.expanded}
|
|
212
211
|
defaultExpanded={section.expanded}
|
|
213
|
-
// titleClassName={styles.titleClassName}
|
|
214
212
|
>
|
|
215
213
|
{section.component}
|
|
216
214
|
</ExpansionPanel>
|
|
@@ -12,6 +12,7 @@ type LinkItem = { link: string, title: string };
|
|
|
12
12
|
interface IBreadcrumbsProps {
|
|
13
13
|
page: string;
|
|
14
14
|
pageProps: any;
|
|
15
|
+
Link: any;
|
|
15
16
|
infoBlockData: { contentMobile: string, title: string }[];
|
|
16
17
|
t?: (key: string, options?: object) => string;
|
|
17
18
|
}
|
|
@@ -32,7 +33,7 @@ class Breadcrumbs extends React.PureComponent<IBreadcrumbsProps> {
|
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
renderList = (list: LinkItem[]) => {
|
|
35
|
-
const {
|
|
36
|
+
const {t = (phrase: string) => _get(breadcrumbsTranslate(), phrase.replace(':', '.'), phrase), page, Link } = this.props;
|
|
36
37
|
|
|
37
38
|
return list.map((item, index): React.ReactElement<any> => {
|
|
38
39
|
const isLastItem: boolean = list.length - 1 === index;
|
|
@@ -43,7 +44,7 @@ class Breadcrumbs extends React.PureComponent<IBreadcrumbsProps> {
|
|
|
43
44
|
|
|
44
45
|
return item.link
|
|
45
46
|
? <span className={linkClassName} onClick={this.props.pageProps.onBreadCrumbClick} key={index}>
|
|
46
|
-
<
|
|
47
|
+
<Link to={page !== 'REFERENCE_VEHICLE_DETAILS' && item.link}>{item.title}</Link>
|
|
47
48
|
</span>
|
|
48
49
|
: <span className={textClassName} key={index}>
|
|
49
50
|
{bigItem}
|
|
@@ -90,4 +91,3 @@ class Breadcrumbs extends React.PureComponent<IBreadcrumbsProps> {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
export default Breadcrumbs;
|
|
93
|
-
// export default withRouter(translate(['common'])(Breadcrumbs));
|