@transferwise/components 46.97.5 → 46.98.1
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/build/alert/Alert.js +8 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +8 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.js +3 -1
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.mjs +3 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/dateInput/DateInput.js +4 -4
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +4 -4
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +4 -4
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +4 -4
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
- package/build/i18n/cs.json +3 -2
- package/build/i18n/cs.json.js +3 -2
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +3 -2
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json +3 -2
- package/build/i18n/de.json.js +3 -2
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +3 -2
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/en.json +3 -2
- package/build/i18n/en.json.js +3 -2
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +3 -2
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/es.json +3 -2
- package/build/i18n/es.json.js +3 -2
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +3 -2
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +3 -2
- package/build/i18n/fr.json.js +3 -2
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +3 -2
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +3 -2
- package/build/i18n/hu.json.js +3 -2
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +3 -2
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +3 -2
- package/build/i18n/id.json.js +3 -2
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +3 -2
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +3 -2
- package/build/i18n/it.json.js +3 -2
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +3 -2
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +3 -2
- package/build/i18n/ja.json.js +3 -2
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +3 -2
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +6 -5
- package/build/i18n/pl.json +3 -2
- package/build/i18n/pl.json.js +3 -2
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +3 -2
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +3 -2
- package/build/i18n/pt.json.js +3 -2
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +3 -2
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +3 -2
- package/build/i18n/ro.json.js +3 -2
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +3 -2
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +3 -2
- package/build/i18n/ru.json.js +3 -2
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +3 -2
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +3 -2
- package/build/i18n/th.json.js +3 -2
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +3 -2
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/tr.json +3 -2
- package/build/i18n/tr.json.js +3 -2
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +3 -2
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +3 -2
- package/build/i18n/zh-CN.json.js +3 -2
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +3 -2
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +3 -2
- package/build/i18n/zh-HK.json.js +3 -2
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +3 -2
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/image/Image.js +9 -10
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs +11 -11
- package/build/image/Image.mjs.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/main.css +16 -45
- package/build/moneyInput/MoneyInput.js +4 -8
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js +3 -0
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.mjs +3 -0
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +4 -8
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +36 -2
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.js +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +36 -2
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/snackbar/Snackbar.js +1 -1
- package/build/snackbar/Snackbar.js.map +1 -1
- package/build/snackbar/Snackbar.mjs +1 -1
- package/build/snackbar/Snackbar.mjs.map +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -0
- package/build/styles/dateInput/DateInput.css +13 -0
- package/build/styles/main.css +16 -45
- package/build/styles/uploadInput/uploadItem/UploadItem.css +2 -1
- package/build/tabs/Tabs.js +3 -3
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +3 -3
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/test-utils/assets/apple-pay-logo.svg +84 -0
- package/build/typeahead/Typeahead.js +2 -2
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +2 -2
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +2 -0
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +0 -1
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.messages.d.ts +5 -0
- package/build/types/moneyInput/MoneyInput.messages.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts +8 -0
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts.map +1 -1
- package/build/types/test-utils/fake-data.d.ts +2 -0
- package/build/types/test-utils/fake-data.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +6 -4
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts +1 -2
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/upload/steps/processingStep/processingStep.d.ts +1 -3
- package/build/types/upload/steps/processingStep/processingStep.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/upload/Upload.js +29 -45
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +29 -45
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -3
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -3
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +54 -6
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +54 -6
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +12 -6
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +12 -6
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +3 -2
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +3 -2
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +14 -17
- package/src/alert/Alert.spec.tsx +11 -0
- package/src/alert/Alert.story.tsx +23 -9
- package/src/alert/Alert.tsx +14 -1
- package/src/circularButton/CircularButton.css +1 -0
- package/src/circularButton/CircularButton.less +1 -0
- package/src/circularButton/CircularButton.tests.story.tsx +23 -0
- package/src/common/closeButton/CloseButton.spec.tsx +13 -1
- package/src/common/closeButton/CloseButton.tsx +3 -0
- package/src/dateInput/DateInput.css +13 -0
- package/src/dateInput/DateInput.less +20 -0
- package/src/dateInput/DateInput.tests.story.tsx +14 -3
- package/src/dateInput/DateInput.tsx +4 -4
- package/src/i18n/cs.json +3 -2
- package/src/i18n/de.json +3 -2
- package/src/i18n/en.json +3 -2
- package/src/i18n/es.json +3 -2
- package/src/i18n/fr.json +3 -2
- package/src/i18n/hu.json +3 -2
- package/src/i18n/id.json +3 -2
- package/src/i18n/it.json +3 -2
- package/src/i18n/ja.json +3 -2
- package/src/i18n/nl.json +6 -5
- package/src/i18n/pl.json +3 -2
- package/src/i18n/pt.json +3 -2
- package/src/i18n/ro.json +3 -2
- package/src/i18n/ru.json +3 -2
- package/src/i18n/th.json +3 -2
- package/src/i18n/tr.json +3 -2
- package/src/i18n/zh-CN.json +3 -2
- package/src/i18n/zh-HK.json +3 -2
- package/src/image/Image.spec.tsx +3 -3
- package/src/image/Image.tsx +10 -12
- package/src/index.ts +0 -2
- package/src/legacylistItem/LegacyListItem.story.tsx +5 -5
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +6 -6
- package/src/main.css +16 -45
- package/src/main.less +0 -1
- package/src/moneyInput/MoneyInput.messages.ts +5 -0
- package/src/moneyInput/MoneyInput.spec.tsx +42 -5
- package/src/moneyInput/MoneyInput.story.tsx +11 -2
- package/src/moneyInput/MoneyInput.tsx +5 -7
- package/src/phoneNumberInput/PhoneNumberInput.messages.ts +8 -0
- package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +77 -43
- package/src/phoneNumberInput/PhoneNumberInput.tsx +34 -2
- package/src/promoCard/__snapshots__/PromoCard.spec.tsx.snap +1 -0
- package/src/promoCard/__snapshots__/PromoCardGroup.spec.tsx.snap +2 -0
- package/src/ssr.spec.tsx +0 -1
- package/src/test-utils/assets/apple-pay-logo.svg +84 -0
- package/src/test-utils/fake-data.ts +5 -0
- package/src/test-utils/jest.setup.ts +0 -4
- package/src/typeahead/Typeahead.spec.tsx +182 -0
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.tsx +103 -0
- package/src/typeahead/util/highlight.spec.tsx +43 -0
- package/src/upload/Upload.spec.tsx +63 -0
- package/src/upload/Upload.story.tsx +0 -51
- package/src/upload/Upload.tests.story.tsx +93 -0
- package/src/upload/Upload.tsx +28 -49
- package/src/upload/steps/processingStep/processingStep.tsx +2 -7
- package/src/uploadInput/UploadInput.tsx +74 -10
- package/src/uploadInput/uploadItem/UploadItem.css +2 -1
- package/src/uploadInput/uploadItem/UploadItem.less +1 -1
- package/src/uploadInput/uploadItem/UploadItem.tsx +11 -6
- package/src/withDisplayFormat/WithDisplayFormat.spec.js +11 -15
- package/src/withDisplayFormat/WithDisplayFormat.tsx +3 -2
- package/build/selectOption/SelectOption.js +0 -131
- package/build/selectOption/SelectOption.js.map +0 -1
- package/build/selectOption/SelectOption.messages.js +0 -17
- package/build/selectOption/SelectOption.messages.js.map +0 -1
- package/build/selectOption/SelectOption.messages.mjs +0 -13
- package/build/selectOption/SelectOption.messages.mjs.map +0 -1
- package/build/selectOption/SelectOption.mjs +0 -127
- package/build/selectOption/SelectOption.mjs.map +0 -1
- package/build/styles/selectOption/SelectOption.css +0 -44
- package/build/types/selectOption/SelectOption.d.ts +0 -21
- package/build/types/selectOption/SelectOption.d.ts.map +0 -1
- package/build/types/selectOption/SelectOption.messages.d.ts +0 -12
- package/build/types/selectOption/SelectOption.messages.d.ts.map +0 -1
- package/build/types/selectOption/index.d.ts +0 -3
- package/build/types/selectOption/index.d.ts.map +0 -1
- package/src/selectOption/SelectOption.css +0 -44
- package/src/selectOption/SelectOption.less +0 -40
- package/src/selectOption/SelectOption.messages.ts +0 -12
- package/src/selectOption/SelectOption.spec.tsx +0 -83
- package/src/selectOption/SelectOption.story.tsx +0 -277
- package/src/selectOption/SelectOption.tsx +0 -151
- package/src/selectOption/index.ts +0 -2
- package/src/typeahead/Typeahead.rtl.spec.tsx +0 -54
- package/src/typeahead/Typeahead.spec.js +0 -404
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.js +0 -74
- package/src/typeahead/typeaheadOption/TypeaheadOption.spec.js +0 -75
- package/src/typeahead/util/highlight.spec.js +0 -34
|
@@ -21,28 +21,30 @@ describe('PhoneNumberInput', () => {
|
|
|
21
21
|
const customRender = (overrides: Partial<PhoneNumberInputProps> = {}, locale?: string) =>
|
|
22
22
|
render(<PhoneNumberInput {...props} {...overrides} />, { locale });
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
const
|
|
24
|
+
const getCountryCodeSelect = () => screen.getByRole('combobox');
|
|
25
|
+
const getCountryCodeLabel = () => screen.getByText('Country code');
|
|
26
|
+
const getPhoneNumberInput = () => screen.getByRole('textbox');
|
|
27
|
+
const getPhoneNumberLabel = () => screen.getByText('Phone number');
|
|
26
28
|
|
|
27
29
|
describe('defaults', () => {
|
|
28
30
|
it('should set prefix control to default UK value', () => {
|
|
29
31
|
customRender();
|
|
30
|
-
expect(
|
|
32
|
+
expect(getCountryCodeSelect()).toHaveTextContent('+44');
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
it('should set number control to empty', () => {
|
|
34
36
|
customRender();
|
|
35
|
-
expect(
|
|
37
|
+
expect(getPhoneNumberInput()).toHaveValue('');
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
it('should not disable the select', () => {
|
|
39
41
|
customRender();
|
|
40
|
-
expect(
|
|
42
|
+
expect(getCountryCodeSelect()).toBeEnabled();
|
|
41
43
|
});
|
|
42
44
|
|
|
43
45
|
it('should not disable the input', () => {
|
|
44
46
|
customRender();
|
|
45
|
-
expect(
|
|
47
|
+
expect(getPhoneNumberInput()).toBeEnabled();
|
|
46
48
|
});
|
|
47
49
|
});
|
|
48
50
|
|
|
@@ -50,22 +52,54 @@ describe('PhoneNumberInput', () => {
|
|
|
50
52
|
const prefix = '+39';
|
|
51
53
|
const number = '123456789';
|
|
52
54
|
customRender({ initialValue: `${prefix}${number}` });
|
|
53
|
-
expect(
|
|
54
|
-
expect(
|
|
55
|
+
expect(getCountryCodeSelect()).toHaveTextContent(prefix);
|
|
56
|
+
expect(getPhoneNumberInput()).toHaveValue(number);
|
|
55
57
|
});
|
|
56
58
|
|
|
57
59
|
describe('id prop', () => {
|
|
58
|
-
it('should
|
|
60
|
+
it('should render sensible default IDs', () => {
|
|
59
61
|
customRender();
|
|
60
|
-
|
|
61
|
-
expect(
|
|
62
|
+
const countryCodeSelectID = getCountryCodeSelect().getAttribute('id');
|
|
63
|
+
expect(countryCodeSelectID).toMatch(/^country-code-select-[a-z0-9]{6}$/);
|
|
64
|
+
const countryCodeLabelID = getCountryCodeLabel().getAttribute('id');
|
|
65
|
+
expect(countryCodeLabelID).toMatch(/^country-code-label-[a-z0-9]{6}$/);
|
|
66
|
+
const phoneNumberInputID = getPhoneNumberInput().getAttribute('id');
|
|
67
|
+
expect(phoneNumberInputID).toMatch(/^phone-number-input-[a-z0-9]{6}$/);
|
|
68
|
+
const phoneNumberLabelID = getPhoneNumberLabel().getAttribute('id');
|
|
69
|
+
expect(phoneNumberLabelID).toMatch(/^phone-number-label-[a-z0-9]{6}$/);
|
|
62
70
|
});
|
|
63
71
|
|
|
64
|
-
it('should
|
|
72
|
+
it('should use the custom `id` as-is for the input but with slight modification for select', () => {
|
|
65
73
|
const id = 'component-id';
|
|
66
74
|
customRender({ id });
|
|
67
|
-
expect(
|
|
68
|
-
expect(
|
|
75
|
+
expect(getPhoneNumberInput()).toHaveAttribute('id', id);
|
|
76
|
+
expect(getPhoneNumberLabel()).toHaveAttribute('id', `${id}-phone-number-label`);
|
|
77
|
+
expect(getCountryCodeSelect()).toHaveAttribute('id', `${id}-country-code-select`);
|
|
78
|
+
expect(getCountryCodeLabel()).toHaveAttribute('id', `${id}-country-code-label`);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('should set correct ARIA attributes on the country code select when id is provided', () => {
|
|
82
|
+
const id = 'my-id';
|
|
83
|
+
customRender({ id });
|
|
84
|
+
expect(getCountryCodeSelect()).toHaveAttribute('aria-labelledby', `${id}-country-code-label`);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should set correct ARIA attributes on the country code select when id is not provided', () => {
|
|
88
|
+
customRender();
|
|
89
|
+
const selectLabelledBy = getCountryCodeSelect().getAttribute('aria-labelledby');
|
|
90
|
+
expect(selectLabelledBy).toMatch(/^country-code-label-[a-z0-9]{6}$/);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('should set correct ARIA attributes on the phone number input when id is provided', () => {
|
|
94
|
+
const id = 'my-id';
|
|
95
|
+
customRender({ id });
|
|
96
|
+
expect(getPhoneNumberInput()).toHaveAttribute('aria-labelledby', `${id}-phone-number-label`);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should set correct ARIA attributes on the phone number input when id is not provided', () => {
|
|
100
|
+
customRender();
|
|
101
|
+
const inputLabelledBy = getPhoneNumberInput().getAttribute('aria-labelledby');
|
|
102
|
+
expect(inputLabelledBy).toMatch(/^phone-number-label-[a-z0-9]{6}$/);
|
|
69
103
|
});
|
|
70
104
|
});
|
|
71
105
|
|
|
@@ -94,38 +128,38 @@ describe('PhoneNumberInput', () => {
|
|
|
94
128
|
it(`'${number}' number should update the value properly`, async () => {
|
|
95
129
|
await renderAndPaste(number);
|
|
96
130
|
|
|
97
|
-
expect(
|
|
98
|
-
expect(
|
|
131
|
+
expect(getCountryCodeSelect()).toHaveTextContent(countryCode);
|
|
132
|
+
expect(getPhoneNumberInput()).toHaveValue(localNumber);
|
|
99
133
|
expect(props.onChange).toHaveBeenCalledWith(number.replace(/[\s-]+/g, ''), countryCode);
|
|
100
134
|
});
|
|
101
135
|
});
|
|
102
136
|
|
|
103
137
|
it('should not paste invalid characters', async () => {
|
|
104
138
|
await renderAndPaste('+36asdasdasd');
|
|
105
|
-
expect(
|
|
106
|
-
expect(
|
|
139
|
+
expect(getCountryCodeSelect()).toHaveTextContent(initialPrefix);
|
|
140
|
+
expect(getPhoneNumberInput()).toHaveValue(initialNumber);
|
|
107
141
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
108
142
|
});
|
|
109
143
|
|
|
110
144
|
it('should not paste countries which are not in the select', async () => {
|
|
111
145
|
await renderAndPaste('+9992342343423');
|
|
112
|
-
expect(
|
|
113
|
-
expect(
|
|
146
|
+
expect(getCountryCodeSelect()).toHaveTextContent(initialPrefix);
|
|
147
|
+
expect(getPhoneNumberInput()).toHaveValue(initialNumber);
|
|
114
148
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
115
149
|
});
|
|
116
150
|
|
|
117
151
|
it("should not paste numbers which doesn't start with the country code", async () => {
|
|
118
152
|
await renderAndPaste('0+36303932551');
|
|
119
|
-
expect(
|
|
120
|
-
expect(
|
|
153
|
+
expect(getCountryCodeSelect()).toHaveTextContent(initialPrefix);
|
|
154
|
+
expect(getPhoneNumberInput()).toHaveValue(initialNumber);
|
|
121
155
|
expect(props.onChange).not.toHaveBeenCalled();
|
|
122
156
|
});
|
|
123
157
|
|
|
124
158
|
it("should allow pasting numbers which don't contain a country code", async () => {
|
|
125
159
|
const newNumber = '06303932551';
|
|
126
160
|
await renderAndPaste(newNumber);
|
|
127
|
-
expect(
|
|
128
|
-
expect(
|
|
161
|
+
expect(getCountryCodeSelect()).toHaveTextContent(initialPrefix);
|
|
162
|
+
expect(getPhoneNumberInput()).toHaveValue(newNumber);
|
|
129
163
|
expect(props.onChange).toHaveBeenCalledWith(`${initialPrefix}${newNumber}`, initialPrefix);
|
|
130
164
|
});
|
|
131
165
|
});
|
|
@@ -136,12 +170,12 @@ describe('PhoneNumberInput', () => {
|
|
|
136
170
|
|
|
137
171
|
it('should set the select to the longest matching prefix', () => {
|
|
138
172
|
customRender(initialProps);
|
|
139
|
-
expect(
|
|
173
|
+
expect(getCountryCodeSelect()).toHaveTextContent('+1868');
|
|
140
174
|
});
|
|
141
175
|
|
|
142
176
|
it('should set the number input to the rest of the number', () => {
|
|
143
177
|
customRender(initialProps);
|
|
144
|
-
expect(
|
|
178
|
+
expect(getPhoneNumberInput()).toHaveValue('123456789');
|
|
145
179
|
});
|
|
146
180
|
});
|
|
147
181
|
|
|
@@ -150,20 +184,20 @@ describe('PhoneNumberInput', () => {
|
|
|
150
184
|
|
|
151
185
|
it('should empty the select', () => {
|
|
152
186
|
customRender(initialProps);
|
|
153
|
-
expect(
|
|
187
|
+
expect(getCountryCodeSelect()).toHaveTextContent('Select an option...');
|
|
154
188
|
});
|
|
155
189
|
|
|
156
190
|
it('should put the whole value in the input without the plus', () => {
|
|
157
191
|
customRender(initialProps);
|
|
158
|
-
expect(
|
|
192
|
+
expect(getPhoneNumberInput()).toHaveValue('999123456789');
|
|
159
193
|
});
|
|
160
194
|
});
|
|
161
195
|
|
|
162
196
|
describe('when an partial model is supplied (with a matching prefix)', () => {
|
|
163
197
|
it('should set the select to the matching prefix and put the rest of the number in the suffix', () => {
|
|
164
198
|
customRender({ initialValue: '+123' });
|
|
165
|
-
expect(
|
|
166
|
-
expect(
|
|
199
|
+
expect(getCountryCodeSelect()).toHaveTextContent('+1');
|
|
200
|
+
expect(getPhoneNumberInput()).toHaveValue('23');
|
|
167
201
|
});
|
|
168
202
|
});
|
|
169
203
|
});
|
|
@@ -171,8 +205,8 @@ describe('PhoneNumberInput', () => {
|
|
|
171
205
|
describe('when disabled is true', () => {
|
|
172
206
|
it('should disable both controls', () => {
|
|
173
207
|
customRender({ disabled: true });
|
|
174
|
-
expect(
|
|
175
|
-
expect(
|
|
208
|
+
expect(getCountryCodeSelect()).toBeDisabled();
|
|
209
|
+
expect(getPhoneNumberInput()).toBeDisabled();
|
|
176
210
|
});
|
|
177
211
|
});
|
|
178
212
|
|
|
@@ -180,13 +214,13 @@ describe('PhoneNumberInput', () => {
|
|
|
180
214
|
it('should use the provided placeholder', () => {
|
|
181
215
|
const placeholder = 'custom placeholder';
|
|
182
216
|
customRender({ placeholder });
|
|
183
|
-
expect(
|
|
217
|
+
expect(getPhoneNumberInput()).toHaveAttribute('placeholder', placeholder);
|
|
184
218
|
});
|
|
185
219
|
|
|
186
220
|
it('should use the provided searchPlaceholder', async () => {
|
|
187
221
|
const searchPlaceholder = 'search placeholder';
|
|
188
222
|
customRender({ searchPlaceholder });
|
|
189
|
-
await userEvent.click(
|
|
223
|
+
await userEvent.click(getCountryCodeSelect());
|
|
190
224
|
expect(screen.getByRole('combobox', { name: searchPlaceholder })).toBeInTheDocument();
|
|
191
225
|
});
|
|
192
226
|
});
|
|
@@ -195,7 +229,7 @@ describe('PhoneNumberInput', () => {
|
|
|
195
229
|
describe('and a value', () => {
|
|
196
230
|
it('should use the prefix of the supplied value', () => {
|
|
197
231
|
customRender({ initialValue: '+12345678' }, 'es');
|
|
198
|
-
expect(
|
|
232
|
+
expect(getCountryCodeSelect()).toHaveTextContent('+1');
|
|
199
233
|
});
|
|
200
234
|
});
|
|
201
235
|
|
|
@@ -203,14 +237,14 @@ describe('PhoneNumberInput', () => {
|
|
|
203
237
|
describe('and no country code', () => {
|
|
204
238
|
it('should default the prefix to the local country', () => {
|
|
205
239
|
customRender(undefined, 'es');
|
|
206
|
-
expect(
|
|
240
|
+
expect(getCountryCodeSelect()).toHaveTextContent('+34');
|
|
207
241
|
});
|
|
208
242
|
});
|
|
209
243
|
|
|
210
244
|
describe('and country code', () => {
|
|
211
245
|
it('should override locale prefix with country specific prefix', () => {
|
|
212
246
|
customRender({ countryCode: 'US' }, 'es');
|
|
213
|
-
expect(
|
|
247
|
+
expect(getCountryCodeSelect()).toHaveTextContent('+1');
|
|
214
248
|
});
|
|
215
249
|
});
|
|
216
250
|
});
|
|
@@ -220,7 +254,7 @@ describe('PhoneNumberInput', () => {
|
|
|
220
254
|
describe('valid number', () => {
|
|
221
255
|
it('should trigger onChange handler', async () => {
|
|
222
256
|
customRender();
|
|
223
|
-
await userEvent.type(
|
|
257
|
+
await userEvent.type(getPhoneNumberInput(), '123');
|
|
224
258
|
expect(props.onChange).toHaveBeenCalledWith('+44123', '+44');
|
|
225
259
|
});
|
|
226
260
|
});
|
|
@@ -228,7 +262,7 @@ describe('PhoneNumberInput', () => {
|
|
|
228
262
|
describe('invalid number', () => {
|
|
229
263
|
it('should trigger onChange with null value', async () => {
|
|
230
264
|
customRender({ initialValue: '+1234' });
|
|
231
|
-
await userEvent.type(
|
|
265
|
+
await userEvent.type(getPhoneNumberInput(), '{Backspace}{Backspace}{Backspace}1');
|
|
232
266
|
expect(props.onChange).toHaveBeenCalledWith(null, '+1');
|
|
233
267
|
});
|
|
234
268
|
});
|
|
@@ -236,7 +270,7 @@ describe('PhoneNumberInput', () => {
|
|
|
236
270
|
describe('when user insert invalid character', () => {
|
|
237
271
|
it('should strip them', async () => {
|
|
238
272
|
customRender({ initialValue: '+12345678' });
|
|
239
|
-
await userEvent.type(
|
|
273
|
+
await userEvent.type(getPhoneNumberInput(), '123--');
|
|
240
274
|
expect(props.onChange).toHaveBeenCalledWith('+12345678123', '+1');
|
|
241
275
|
});
|
|
242
276
|
});
|
|
@@ -244,8 +278,8 @@ describe('PhoneNumberInput', () => {
|
|
|
244
278
|
describe('overlapping prefix and suffix numbers', () => {
|
|
245
279
|
it("shouldn't change the prefix number on matching suffix input", async () => {
|
|
246
280
|
customRender({ countryCode: 'eg' });
|
|
247
|
-
await userEvent.type(
|
|
248
|
-
expect(
|
|
281
|
+
await userEvent.type(getPhoneNumberInput(), '1111111');
|
|
282
|
+
expect(getPhoneNumberInput()).toHaveValue('1111111');
|
|
249
283
|
expect(props.onChange).toHaveBeenCalledWith('+201111111', '+20');
|
|
250
284
|
});
|
|
251
285
|
});
|
|
@@ -254,7 +288,7 @@ describe('PhoneNumberInput', () => {
|
|
|
254
288
|
describe('when selectProps is supplied', () => {
|
|
255
289
|
it('renders Select component with expected props', () => {
|
|
256
290
|
customRender({ selectProps: { className: 'custom-class' } });
|
|
257
|
-
expect(
|
|
291
|
+
expect(getCountryCodeSelect().parentElement).toHaveClass('custom-class');
|
|
258
292
|
});
|
|
259
293
|
});
|
|
260
294
|
|
|
@@ -4,7 +4,6 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
import { Size, SizeLarge, SizeMedium, SizeSmall } from '../common';
|
|
5
5
|
import { useInputAttributes } from '../inputs/contexts';
|
|
6
6
|
import { SelectInput, SelectInputOptionContent, SelectInputProps } from '../inputs/SelectInput';
|
|
7
|
-
|
|
8
7
|
import messages from './PhoneNumberInput.messages';
|
|
9
8
|
import countries from './data/countries';
|
|
10
9
|
import {
|
|
@@ -64,6 +63,25 @@ const PhoneNumberInput = ({
|
|
|
64
63
|
|
|
65
64
|
const { locale, formatMessage } = useIntl();
|
|
66
65
|
|
|
66
|
+
const createId = (customID: string | undefined, backup: string): string => {
|
|
67
|
+
if (customID) {
|
|
68
|
+
return customID + (backup ? `-${backup}` : '');
|
|
69
|
+
}
|
|
70
|
+
const random = Math.random().toString(36).slice(2, 8);
|
|
71
|
+
return `${backup}-${random}`;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const ids = {
|
|
75
|
+
countryCode: {
|
|
76
|
+
label: createId(id, 'country-code-label'),
|
|
77
|
+
select: createId(id, 'country-code-select'),
|
|
78
|
+
},
|
|
79
|
+
phoneNumber: {
|
|
80
|
+
label: createId(id, 'phone-number-label'),
|
|
81
|
+
input: createId(id, id ? '' : 'phone-number-input'),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
67
85
|
const [internalValue, setInternalValue] = useState<PhoneNumber>(() => {
|
|
68
86
|
const cleanValue = initialValue ? cleanNumber(initialValue) : null;
|
|
69
87
|
|
|
@@ -151,6 +169,9 @@ const PhoneNumberInput = ({
|
|
|
151
169
|
aria-labelledby={ariaLabelledBy}
|
|
152
170
|
className="tw-telephone"
|
|
153
171
|
>
|
|
172
|
+
<label className="sr-only" id={ids.countryCode.label}>
|
|
173
|
+
{formatMessage(messages.countryCodeLabel)}
|
|
174
|
+
</label>
|
|
154
175
|
<div className="tw-telephone__country-select">
|
|
155
176
|
<SelectInput
|
|
156
177
|
placeholder={formatMessage(messages.selectInputPlaceholder)}
|
|
@@ -181,6 +202,13 @@ const PhoneNumberInput = ({
|
|
|
181
202
|
filterPlaceholder={searchPlaceholder}
|
|
182
203
|
disabled={disabled}
|
|
183
204
|
size={size}
|
|
205
|
+
id={ids.countryCode.select}
|
|
206
|
+
UNSAFE_triggerButtonProps={{
|
|
207
|
+
id: ids.countryCode.select,
|
|
208
|
+
'aria-labelledby': ids.countryCode.label,
|
|
209
|
+
'aria-describedby': undefined,
|
|
210
|
+
'aria-invalid': undefined,
|
|
211
|
+
}}
|
|
184
212
|
onChange={(prefix) => {
|
|
185
213
|
const country = prefix != null ? findCountryByPrefix(prefix) : null;
|
|
186
214
|
setInternalValue((prev) => ({ ...prev, prefix, format: country?.phoneFormat }));
|
|
@@ -193,10 +221,13 @@ const PhoneNumberInput = ({
|
|
|
193
221
|
{...selectProps}
|
|
194
222
|
/>
|
|
195
223
|
</div>
|
|
224
|
+
<label className="sr-only" id={ids.phoneNumber.label} htmlFor={ids.phoneNumber.input}>
|
|
225
|
+
{formatMessage(messages.phoneNumberLabel)}
|
|
226
|
+
</label>
|
|
196
227
|
<div className="tw-telephone__number-input">
|
|
197
228
|
<div className={`input-group input-group-${size}`}>
|
|
198
229
|
<Input
|
|
199
|
-
id={
|
|
230
|
+
id={ids.phoneNumber.input}
|
|
200
231
|
autoComplete="tel-national"
|
|
201
232
|
name="phoneNumber"
|
|
202
233
|
inputMode="numeric"
|
|
@@ -204,6 +235,7 @@ const PhoneNumberInput = ({
|
|
|
204
235
|
disabled={disabled}
|
|
205
236
|
required={required}
|
|
206
237
|
placeholder={placeholder}
|
|
238
|
+
aria-labelledby={ids.phoneNumber.label}
|
|
207
239
|
onChange={onSuffixChange}
|
|
208
240
|
onPaste={onPaste}
|
|
209
241
|
onFocus={onFocus}
|
|
@@ -33,6 +33,7 @@ exports[`PromoCardGroup matches snapshot 1`] = `
|
|
|
33
33
|
<img
|
|
34
34
|
alt=""
|
|
35
35
|
class="tw-image tw-image__stretch tw-image__shrink"
|
|
36
|
+
loading="lazy"
|
|
36
37
|
src="https://via.placeholder.com/150"
|
|
37
38
|
/>
|
|
38
39
|
</div>
|
|
@@ -67,6 +68,7 @@ exports[`PromoCardGroup matches snapshot 1`] = `
|
|
|
67
68
|
<img
|
|
68
69
|
alt=""
|
|
69
70
|
class="tw-image tw-image__stretch tw-image__shrink"
|
|
71
|
+
loading="lazy"
|
|
70
72
|
src="https://via.placeholder.com/150"
|
|
71
73
|
/>
|
|
72
74
|
</div>
|
package/src/ssr.spec.tsx
CHANGED
|
@@ -228,7 +228,6 @@ describe('Server side rendering', () => {
|
|
|
228
228
|
DateLookup: { value: new Date() },
|
|
229
229
|
Link: { size: 16 },
|
|
230
230
|
Tooltip: { children: <>yo</> },
|
|
231
|
-
SelectOption: { placeholder: { media: <img alt="img" /> } },
|
|
232
231
|
};
|
|
233
232
|
|
|
234
233
|
const { Provider } = exposedLibraryItems;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Artwork" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
width="165.52107px" height="105.9651px" viewBox="0 0 165.52107 105.9651" enable-background="new 0 0 165.52107 105.9651"
|
|
5
|
+
xml:space="preserve">
|
|
6
|
+
<g>
|
|
7
|
+
<path id="XMLID_4_" d="M150.69807,0H14.82318c-0.5659,0-1.1328,0-1.69769,0.0033c-0.47751,0.0034-0.95391,0.0087-1.43031,0.0217
|
|
8
|
+
c-1.039,0.0281-2.0869,0.0894-3.1129,0.2738c-1.0424,0.1876-2.0124,0.4936-2.9587,0.9754
|
|
9
|
+
c-0.9303,0.4731-1.782,1.0919-2.52009,1.8303c-0.73841,0.7384-1.35721,1.5887-1.83021,2.52
|
|
10
|
+
c-0.4819,0.9463-0.7881,1.9166-0.9744,2.9598c-0.18539,1.0263-0.2471,2.074-0.2751,3.1119
|
|
11
|
+
c-0.0128,0.4764-0.01829,0.9528-0.0214,1.4291c-0.0033,0.5661-0.0022,1.1318-0.0022,1.6989V91.142
|
|
12
|
+
c0,0.5671-0.0011,1.13181,0.0022,1.69901c0.00311,0.4763,0.0086,0.9527,0.0214,1.4291
|
|
13
|
+
c0.028,1.03699,0.08971,2.08469,0.2751,3.11069c0.1863,1.0436,0.4925,2.0135,0.9744,2.9599
|
|
14
|
+
c0.473,0.9313,1.0918,1.7827,1.83021,2.52c0.73809,0.7396,1.58979,1.3583,2.52009,1.8302
|
|
15
|
+
c0.9463,0.4831,1.9163,0.7892,2.9587,0.9767c1.026,0.1832,2.0739,0.2456,3.1129,0.2737c0.4764,0.0108,0.9528,0.0172,1.43031,0.0194
|
|
16
|
+
c0.56489,0.0044,1.13179,0.0044,1.69769,0.0044h135.87489c0.5649,0,1.13181,0,1.69659-0.0044
|
|
17
|
+
c0.47641-0.0022,0.95282-0.0086,1.4314-0.0194c1.0368-0.0281,2.0845-0.0905,3.11301-0.2737
|
|
18
|
+
c1.041-0.1875,2.0112-0.4936,2.9576-0.9767c0.9313-0.4719,1.7805-1.0906,2.52011-1.8302c0.7372-0.7373,1.35599-1.5887,1.8302-2.52
|
|
19
|
+
c0.48299-0.9464,0.78889-1.9163,0.97429-2.9599c0.1855-1.026,0.2457-2.0737,0.2738-3.11069
|
|
20
|
+
c0.013-0.4764,0.01941-0.9528,0.02161-1.4291c0.00439-0.5672,0.00439-1.1319,0.00439-1.69901V14.8242
|
|
21
|
+
c0-0.5671,0-1.1328-0.00439-1.6989c-0.0022-0.4763-0.00861-0.9527-0.02161-1.4291c-0.02811-1.0379-0.0883-2.0856-0.2738-3.1119
|
|
22
|
+
c-0.18539-1.0432-0.4913-2.0135-0.97429-2.9598c-0.47421-0.9313-1.093-1.7816-1.8302-2.52
|
|
23
|
+
c-0.73961-0.7384-1.58881-1.3572-2.52011-1.8303c-0.9464-0.4818-1.9166-0.7878-2.9576-0.9754
|
|
24
|
+
c-1.0285-0.1844-2.0762-0.2457-3.11301-0.2738c-0.47858-0.013-0.95499-0.0183-1.4314-0.0217C151.82988,0,151.26297,0,150.69807,0
|
|
25
|
+
L150.69807,0z"/>
|
|
26
|
+
<path id="XMLID_3_" fill="#FFFFFF" d="M150.69807,3.532l1.67149,0.0032c0.4528,0.0032,0.90561,0.0081,1.36092,0.0205
|
|
27
|
+
c0.79201,0.0214,1.71849,0.0643,2.58209,0.2191c0.7507,0.1352,1.38029,0.3408,1.9845,0.6484
|
|
28
|
+
c0.5965,0.3031,1.14301,0.7003,1.62019,1.1768c0.479,0.4797,0.87671,1.0271,1.18381,1.6302
|
|
29
|
+
c0.30589,0.5995,0.51019,1.2261,0.64459,1.9823c0.1544,0.8542,0.1971,1.7832,0.21881,2.5801
|
|
30
|
+
c0.01219,0.4498,0.01819,0.8996,0.0204,1.3601c0.00429,0.5569,0.0042,1.1135,0.0042,1.6715V91.142
|
|
31
|
+
c0,0.558,0.00009,1.1136-0.0043,1.6824c-0.00211,0.4497-0.0081,0.8995-0.0204,1.3501c-0.02161,0.7957-0.0643,1.7242-0.2206,2.5885
|
|
32
|
+
c-0.13251,0.7458-0.3367,1.3725-0.64429,1.975c-0.30621,0.6016-0.70331,1.1484-1.18022,1.6251
|
|
33
|
+
c-0.47989,0.48-1.0246,0.876-1.62819,1.1819c-0.5997,0.3061-1.22821,0.51151-1.97151,0.6453
|
|
34
|
+
c-0.88109,0.157-1.84639,0.2002-2.57339,0.2199c-0.4574,0.0103-0.9126,0.01649-1.37889,0.0187
|
|
35
|
+
c-0.55571,0.0043-1.1134,0.0042-1.6692,0.0042H14.82318c-0.0074,0-0.0146,0-0.0221,0c-0.5494,0-1.0999,0-1.6593-0.0043
|
|
36
|
+
c-0.4561-0.00211-0.9112-0.0082-1.3512-0.0182c-0.7436-0.0201-1.7095-0.0632-2.5834-0.2193
|
|
37
|
+
c-0.74969-0.1348-1.3782-0.3402-1.9858-0.6503c-0.59789-0.3032-1.1422-0.6988-1.6223-1.1797
|
|
38
|
+
c-0.4764-0.4756-0.8723-1.0207-1.1784-1.6232c-0.3064-0.6019-0.5114-1.2305-0.64619-1.9852
|
|
39
|
+
c-0.15581-0.8626-0.19861-1.7874-0.22-2.5777c-0.01221-0.4525-0.01731-0.9049-0.02021-1.3547l-0.0022-1.3279l0.0001-0.3506V14.8242
|
|
40
|
+
l-0.0001-0.3506l0.0021-1.3251c0.003-0.4525,0.0081-0.9049,0.02031-1.357c0.02139-0.7911,0.06419-1.7163,0.22129-2.5861
|
|
41
|
+
c0.1336-0.7479,0.3385-1.3765,0.6465-1.9814c0.3037-0.5979,0.7003-1.1437,1.17921-1.6225
|
|
42
|
+
c0.477-0.4772,1.02309-0.8739,1.62479-1.1799c0.6011-0.3061,1.2308-0.5116,1.9805-0.6465c0.8638-0.1552,1.7909-0.198,2.5849-0.2195
|
|
43
|
+
c0.4526-0.0123,0.9052-0.0172,1.3544-0.0203l1.6771-0.0033H150.69807"/>
|
|
44
|
+
<g>
|
|
45
|
+
<g>
|
|
46
|
+
<path d="M45.1862,35.64053c1.41724-1.77266,2.37897-4.15282,2.12532-6.58506c-2.07464,0.10316-4.60634,1.36871-6.07207,3.14276
|
|
47
|
+
c-1.31607,1.5192-2.4809,3.99902-2.17723,6.3293C41.39111,38.72954,43.71785,37.36345,45.1862,35.64053"/>
|
|
48
|
+
<path d="M47.28506,38.98252c-3.38211-0.20146-6.25773,1.91951-7.87286,1.91951c-1.61602,0-4.08931-1.81799-6.76438-1.76899
|
|
49
|
+
c-3.48177,0.05114-6.71245,2.01976-8.4793,5.15079c-3.63411,6.2636-0.95904,15.55471,2.57494,20.65606
|
|
50
|
+
c1.71618,2.5238,3.78447,5.30269,6.50976,5.20287c2.57494-0.10104,3.58421-1.66732,6.71416-1.66732
|
|
51
|
+
c3.12765,0,4.03679,1.66732,6.76252,1.61681c2.82665-0.05054,4.59381-2.52506,6.30997-5.05132
|
|
52
|
+
c1.96878-2.877,2.77473-5.65498,2.82542-5.80748c-0.0507-0.05051-5.45058-2.12204-5.50065-8.33358
|
|
53
|
+
c-0.05098-5.20101,4.23951-7.6749,4.44144-7.82832C52.3832,39.4881,48.5975,39.08404,47.28506,38.98252"/>
|
|
54
|
+
</g>
|
|
55
|
+
<g>
|
|
56
|
+
<path d="M76.73385,31.94381c7.35096,0,12.4697,5.06708,12.4697,12.44437c0,7.40363-5.22407,12.49704-12.65403,12.49704h-8.13892
|
|
57
|
+
v12.94318h-5.88037v-37.8846H76.73385z M68.41059,51.9493h6.74732c5.11975,0,8.0336-2.75636,8.0336-7.53479
|
|
58
|
+
c0-4.77792-2.91385-7.50845-8.00727-7.50845h-6.77365V51.9493z"/>
|
|
59
|
+
<path d="M90.73997,61.97864c0-4.8311,3.70182-7.79761,10.26583-8.16526l7.56061-0.44614v-2.12639
|
|
60
|
+
c0-3.07185-2.07423-4.90959-5.53905-4.90959c-3.28251,0-5.33041,1.57492-5.82871,4.04313h-5.35574
|
|
61
|
+
c0.31499-4.98859,4.56777-8.66407,11.3941-8.66407c6.69466,0,10.97377,3.54432,10.97377,9.08388v19.03421h-5.43472v-4.54194
|
|
62
|
+
h-0.13065c-1.60125,3.07185-5.09341,5.01441-8.71623,5.01441C94.52078,70.30088,90.73997,66.94038,90.73997,61.97864z
|
|
63
|
+
M108.56641,59.4846v-2.17905l-6.8,0.41981c-3.38683,0.23649-5.30306,1.73291-5.30306,4.09579
|
|
64
|
+
c0,2.41504,1.99523,3.99046,5.04075,3.99046C105.46823,65.81161,108.56641,63.08108,108.56641,59.4846z"/>
|
|
65
|
+
<path d="M119.34167,79.9889v-4.5946c0.4193,0.10483,1.36425,0.10483,1.83723,0.10483c2.6252,0,4.04313-1.10245,4.90908-3.9378
|
|
66
|
+
c0-0.05267,0.49931-1.68025,0.49931-1.70658l-9.97616-27.64562h6.14268l6.98432,22.47371h0.10432l6.98433-22.47371h5.9857
|
|
67
|
+
l-10.34483,29.06304c-2.36186,6.69517-5.0924,8.84789-10.81577,8.84789C121.17891,80.12006,119.76098,80.06739,119.34167,79.9889
|
|
68
|
+
z"/>
|
|
69
|
+
</g>
|
|
70
|
+
</g>
|
|
71
|
+
</g>
|
|
72
|
+
<g>
|
|
73
|
+
</g>
|
|
74
|
+
<g>
|
|
75
|
+
</g>
|
|
76
|
+
<g>
|
|
77
|
+
</g>
|
|
78
|
+
<g>
|
|
79
|
+
</g>
|
|
80
|
+
<g>
|
|
81
|
+
</g>
|
|
82
|
+
<g>
|
|
83
|
+
</g>
|
|
84
|
+
</svg>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
export const lorem5 = 'Lorem ipsum dolor sit amet.';
|
|
2
|
+
|
|
1
3
|
export const lorem10 =
|
|
2
4
|
'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iste, architecto?';
|
|
3
5
|
|
|
6
|
+
export const lorem20 =
|
|
7
|
+
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum non explicabo doloribus rerum saepe ut beatae adipisci rem vero optio.';
|
|
8
|
+
|
|
4
9
|
export const lorem40 =
|
|
5
10
|
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Illo esse quod et iure deserunt facilis similique voluptatem reprehenderit mollitia inventore, ab voluptate dignissimos autem repellat accusamus perferendis sed pariatur tempore possimus ipsam praesentium ipsum? Nesciunt cumque repellendus impedit aliquam! Error?';
|
|
6
11
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import util from 'node:util';
|
|
2
2
|
import '@testing-library/jest-dom';
|
|
3
3
|
|
|
4
|
-
import Adapter from '@cfaester/enzyme-adapter-react-18';
|
|
5
|
-
import Enzyme from 'enzyme';
|
|
6
4
|
import fetchMock from 'jest-fetch-mock';
|
|
7
5
|
|
|
8
6
|
global.fetch = fetchMock as unknown as typeof global.fetch;
|
|
9
7
|
|
|
10
|
-
Enzyme.configure({ adapter: new Adapter() });
|
|
11
|
-
|
|
12
8
|
global.requestAnimationFrame = (callback: (time: number) => void): number => {
|
|
13
9
|
callback(performance.now());
|
|
14
10
|
return 0;
|