@transferwise/components 0.0.0-experimental-50e1f17 → 0.0.0-experimental-08d336e
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/index.esm.js +3327 -3404
- package/build/index.esm.js.map +1 -1
- package/build/index.js +3326 -3402
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/logo/Logo.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/moneyInput/MoneyInput.css +1 -1
- package/build/types/common/hooks/useLayout/useLayout.d.ts +9 -6
- package/build/types/common/hooks/useLayout/useLayout.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +1 -2
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/hooks/useLayout/useLayout.ts +21 -49
- package/src/common/responsivePanel/ResponsivePanel.spec.js +3 -1
- package/src/dateLookup/DateLookup.testingLibrary.spec.js +1 -19
- package/src/dateLookup/dateHeader/DateHeader.spec.js +2 -0
- package/src/drawer/Drawer.rtl.spec.js +3 -1
- package/src/drawer/Drawer.spec.js +2 -0
- package/src/index.ts +1 -0
- package/src/info/Info.spec.js +7 -11
- package/src/inputs/SelectInput.tsx +0 -8
- package/src/logo/Logo.css +1 -1
- package/src/logo/Logo.js +9 -18
- package/src/logo/Logo.less +21 -2
- package/src/logo/__snapshots__/Logo.spec.js.snap +168 -72
- package/src/main.css +1 -1
- package/src/modal/Modal.rtl.spec.js +3 -1
- package/src/modal/Modal.spec.js +2 -0
- package/src/modal/Modal.tsx +2 -2
- package/src/moneyInput/MoneyInput.css +1 -1
- package/src/moneyInput/MoneyInput.js +34 -82
- package/src/moneyInput/MoneyInput.less +28 -24
- package/src/moneyInput/MoneyInput.spec.js +112 -243
- package/src/moneyInput/MoneyInput.story.tsx +1 -51
- package/src/ssr.spec.js +1 -0
- package/src/uploadInput/UploadInput.spec.tsx +3 -1
- package/src/moneyInput/MoneyInput.rtl.spec.js +0 -71
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { mockMatchMedia, mockResizeObserver, render, userEvent } from '../test-utils';
|
|
2
|
-
|
|
3
|
-
import MoneyInput from './MoneyInput';
|
|
4
|
-
|
|
5
|
-
mockMatchMedia();
|
|
6
|
-
mockResizeObserver();
|
|
7
|
-
|
|
8
|
-
describe('MoneyInput', () => {
|
|
9
|
-
const currencies = [
|
|
10
|
-
{
|
|
11
|
-
header: 'Popular currencies',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
value: 'EUR',
|
|
15
|
-
label: 'EUR',
|
|
16
|
-
note: 'Euro',
|
|
17
|
-
currency: 'eur',
|
|
18
|
-
searchable: 'Spain, Germany, France, Austria, Estonia',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
value: 'USD',
|
|
22
|
-
label: 'USD',
|
|
23
|
-
note: 'United States dollar',
|
|
24
|
-
currency: 'usd',
|
|
25
|
-
searchable: 'Hong Kong, Saudi Arabia',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
value: 'GBP',
|
|
29
|
-
label: 'GBP',
|
|
30
|
-
note: 'British pound',
|
|
31
|
-
currency: 'gbp',
|
|
32
|
-
searchable: 'England, Scotland, Wales',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
header: 'Some other currencies',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
value: 'CAD',
|
|
39
|
-
label: 'CAD',
|
|
40
|
-
note: 'Canadian dollar',
|
|
41
|
-
currency: 'cad',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
value: 'AUD',
|
|
45
|
-
label: 'AUD',
|
|
46
|
-
note: 'Australian dollar',
|
|
47
|
-
currency: 'aud',
|
|
48
|
-
},
|
|
49
|
-
];
|
|
50
|
-
const props = {
|
|
51
|
-
currencies,
|
|
52
|
-
selectedCurrency: currencies[1],
|
|
53
|
-
amount: 1000,
|
|
54
|
-
onAmountChange: jest.fn(),
|
|
55
|
-
onCurrencyChange: jest.fn(),
|
|
56
|
-
};
|
|
57
|
-
it.each([
|
|
58
|
-
['asd', ''],
|
|
59
|
-
['1a2s3d', '123'],
|
|
60
|
-
['±!@#$^*_+?><', ''],
|
|
61
|
-
['1±!@#$^*,_+?><2', '1,2'],
|
|
62
|
-
['12,3', '12,3'],
|
|
63
|
-
['12.3', '12.3'],
|
|
64
|
-
])("ignores the letters when typed '%s' and shows '%s'", (testValue, expectedValue) => {
|
|
65
|
-
const { container } = render(<MoneyInput {...props} amount={null} />);
|
|
66
|
-
|
|
67
|
-
const input = container.querySelector('input');
|
|
68
|
-
userEvent.type(input, testValue);
|
|
69
|
-
expect(input).toHaveValue(expectedValue);
|
|
70
|
-
});
|
|
71
|
-
});
|