@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.
Files changed (42) hide show
  1. package/build/index.esm.js +3327 -3404
  2. package/build/index.esm.js.map +1 -1
  3. package/build/index.js +3326 -3402
  4. package/build/index.js.map +1 -1
  5. package/build/main.css +1 -1
  6. package/build/styles/logo/Logo.css +1 -1
  7. package/build/styles/main.css +1 -1
  8. package/build/styles/moneyInput/MoneyInput.css +1 -1
  9. package/build/types/common/hooks/useLayout/useLayout.d.ts +9 -6
  10. package/build/types/common/hooks/useLayout/useLayout.d.ts.map +1 -1
  11. package/build/types/index.d.ts +1 -0
  12. package/build/types/index.d.ts.map +1 -1
  13. package/build/types/inputs/SelectInput.d.ts +1 -2
  14. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  15. package/build/types/logo/Logo.d.ts.map +1 -1
  16. package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
  17. package/package.json +1 -1
  18. package/src/common/hooks/useLayout/useLayout.ts +21 -49
  19. package/src/common/responsivePanel/ResponsivePanel.spec.js +3 -1
  20. package/src/dateLookup/DateLookup.testingLibrary.spec.js +1 -19
  21. package/src/dateLookup/dateHeader/DateHeader.spec.js +2 -0
  22. package/src/drawer/Drawer.rtl.spec.js +3 -1
  23. package/src/drawer/Drawer.spec.js +2 -0
  24. package/src/index.ts +1 -0
  25. package/src/info/Info.spec.js +7 -11
  26. package/src/inputs/SelectInput.tsx +0 -8
  27. package/src/logo/Logo.css +1 -1
  28. package/src/logo/Logo.js +9 -18
  29. package/src/logo/Logo.less +21 -2
  30. package/src/logo/__snapshots__/Logo.spec.js.snap +168 -72
  31. package/src/main.css +1 -1
  32. package/src/modal/Modal.rtl.spec.js +3 -1
  33. package/src/modal/Modal.spec.js +2 -0
  34. package/src/modal/Modal.tsx +2 -2
  35. package/src/moneyInput/MoneyInput.css +1 -1
  36. package/src/moneyInput/MoneyInput.js +34 -82
  37. package/src/moneyInput/MoneyInput.less +28 -24
  38. package/src/moneyInput/MoneyInput.spec.js +112 -243
  39. package/src/moneyInput/MoneyInput.story.tsx +1 -51
  40. package/src/ssr.spec.js +1 -0
  41. package/src/uploadInput/UploadInput.spec.tsx +3 -1
  42. 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
- });