@transferwise/components 0.0.0-experimental-29ce40f → 0.0.0-experimental-04e4d95

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 (83) hide show
  1. package/build/index.js +524 -15
  2. package/build/index.js.map +1 -1
  3. package/build/index.mjs +524 -17
  4. package/build/index.mjs.map +1 -1
  5. package/build/main.css +5 -0
  6. package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +5 -0
  7. package/build/styles/main.css +5 -0
  8. package/build/types/alert/Alert.d.ts.map +1 -1
  9. package/build/types/common/requirements.d.ts +3 -0
  10. package/build/types/common/requirements.d.ts.map +1 -0
  11. package/build/types/dimmer/Dimmer.d.ts.map +1 -1
  12. package/build/types/dynamicFieldDefinitionList/DynamicFieldDefinitionList.d.ts +21 -0
  13. package/build/types/dynamicFieldDefinitionList/DynamicFieldDefinitionList.d.ts.map +1 -0
  14. package/build/types/dynamicFieldDefinitionList/FormattedValue/FormattedValue.d.ts +12 -0
  15. package/build/types/dynamicFieldDefinitionList/FormattedValue/FormattedValue.d.ts.map +1 -0
  16. package/build/types/dynamicFieldDefinitionList/FormattedValue/index.d.ts +2 -0
  17. package/build/types/dynamicFieldDefinitionList/FormattedValue/index.d.ts.map +1 -0
  18. package/build/types/dynamicFieldDefinitionList/index.d.ts +2 -0
  19. package/build/types/dynamicFieldDefinitionList/index.d.ts.map +1 -0
  20. package/build/types/dynamicFieldDefinitionList/utils/createDefinitions.d.ts +2 -0
  21. package/build/types/dynamicFieldDefinitionList/utils/createDefinitions.d.ts.map +1 -0
  22. package/build/types/dynamicFieldDefinitionList/utils/text-format.d.ts +2 -0
  23. package/build/types/dynamicFieldDefinitionList/utils/text-format.d.ts.map +1 -0
  24. package/build/types/index.d.ts +1 -0
  25. package/build/types/index.d.ts.map +1 -1
  26. package/build/types/loader/Loader.d.ts.map +1 -1
  27. package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
  28. package/build/types/popover/Popover.d.ts.map +1 -1
  29. package/build/types/select/Select.d.ts.map +1 -1
  30. package/build/types/stepper/deviceDetection.d.ts.map +1 -1
  31. package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
  32. package/package.json +3 -3
  33. package/src/accordion/Accordion.story.tsx +1 -1
  34. package/src/alert/Alert.tsx +2 -1
  35. package/src/avatar/colors/colors.ts +1 -1
  36. package/src/body/Body.spec.tsx +1 -1
  37. package/src/body/Body.story.tsx +8 -8
  38. package/src/checkbox/Checkbox.js +1 -1
  39. package/src/checkboxButton/CheckboxButton.spec.tsx +0 -1
  40. package/src/common/Option/Option.tsx +1 -1
  41. package/src/common/deviceDetection/deviceDetection.js +1 -1
  42. package/src/common/deviceDetection/deviceDetection.spec.js +4 -2
  43. package/src/common/responsivePanel/ResponsivePanel.spec.js +11 -15
  44. package/src/decision/Decision.spec.js +0 -1
  45. package/src/dimmer/Dimmer.tsx +6 -2
  46. package/src/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +41 -0
  47. package/src/dynamicFieldDefinitionList/DynamicFieldDefinitionList.spec.js +21 -0
  48. package/src/dynamicFieldDefinitionList/DynamicFieldDefinitionList.story.js +134 -0
  49. package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +5 -0
  50. package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +73 -0
  51. package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.less +4 -0
  52. package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.spec.js +200 -0
  53. package/src/dynamicFieldDefinitionList/FormattedValue/index.js +1 -0
  54. package/src/dynamicFieldDefinitionList/index.js +1 -0
  55. package/src/dynamicFieldDefinitionList/utils/createDefinitions.js +33 -0
  56. package/src/dynamicFieldDefinitionList/utils/createDefinitions.spec.js +83 -0
  57. package/src/dynamicFieldDefinitionList/utils/text-format.js +46 -0
  58. package/src/dynamicFieldDefinitionList/utils/text-format.spec.js +43 -0
  59. package/src/index.ts +1 -0
  60. package/src/inlineAlert/InlineAlert.story.tsx +8 -7
  61. package/src/link/Link.story.tsx +16 -16
  62. package/src/loader/Loader.tsx +0 -1
  63. package/src/logo/Logo.js +2 -2
  64. package/src/main.css +5 -0
  65. package/src/main.less +1 -0
  66. package/src/moneyInput/MoneyInput.story.tsx +3 -3
  67. package/src/nudge/Nudge.spec.tsx +5 -5
  68. package/src/phoneNumberInput/PhoneNumberInput.tsx +2 -1
  69. package/src/phoneNumberInput/utils/cleanNumber/cleanNumber.ts +1 -1
  70. package/src/popover/Popover.tsx +2 -1
  71. package/src/promoCard/PromoCard.tsx +1 -1
  72. package/src/radioGroup/RadioGroup.spec.js +1 -1
  73. package/src/section/Section.story.tsx +2 -1
  74. package/src/segmentedControl/SegmentedControl.spec.tsx +2 -2
  75. package/src/select/Select.js +2 -3
  76. package/src/stepper/deviceDetection.js +1 -2
  77. package/src/stepper/deviceDetection.spec.js +8 -3
  78. package/src/test-utils/index.js +1 -1
  79. package/src/test-utils/story-config.ts +1 -1
  80. package/src/title/Title.spec.tsx +1 -1
  81. package/src/typeahead/Typeahead.spec.js +4 -2
  82. package/src/upload/Upload.spec.js +8 -4
  83. package/src/uploadInput/uploadButton/UploadButton.tsx +1 -0
@@ -29,64 +29,64 @@ export const Basic = () => {
29
29
  Links via <code>{'<Link />'}</code> component in all types of body copy
30
30
  </Title>
31
31
  <Body type={Typography.BODY_LARGE_BOLD} className="m-t-3">
32
- We’re building the world's{' '}
32
+ We’re building the worlds{' '}
33
33
  <Link href="#" target="_blank">
34
34
  most international account
35
35
  </Link>
36
- . We’re building the world's most international account
36
+ . We’re building the worlds most international account
37
37
  </Body>
38
38
  <Body type={Typography.BODY_LARGE} className="m-t-3">
39
- We’re building the world's{' '}
39
+ We’re building the worlds{' '}
40
40
  <Link href="#" target="_blank">
41
41
  most international account
42
42
  </Link>
43
- . We’re building the world's most international account
43
+ . We’re building the worlds most international account
44
44
  </Body>
45
45
  <Body type={Typography.BODY_DEFAULT_BOLD} className="m-t-3">
46
- We’re building the world's{' '}
46
+ We’re building the worlds{' '}
47
47
  <Link href="#" target="_blank">
48
48
  most international account
49
49
  </Link>
50
- . We’re building the world's most international account
50
+ . We’re building the worlds most international account
51
51
  </Body>
52
52
  <Body type={Typography.BODY_DEFAULT} className="m-t-3">
53
- We’re building the world's{' '}
53
+ We’re building the worlds{' '}
54
54
  <Link href="#" target="_blank">
55
55
  most international account
56
56
  </Link>
57
- . We’re building the world's most international account
57
+ . We’re building the worlds most international account
58
58
  </Body>
59
59
 
60
60
  <Title type={Typography.TITLE_SCREEN} className="m-t-3">
61
61
  Links via <code>{'<a>'}</code> tag in all types of body copy
62
62
  </Title>
63
63
  <Body type={Typography.BODY_LARGE_BOLD} className="m-t-3">
64
- We’re building the world's{' '}
64
+ We’re building the worlds{' '}
65
65
  <a href="#" target="_blank">
66
66
  most international account
67
67
  </a>
68
- . We’re building the world's most international account
68
+ . We’re building the worlds most international account
69
69
  </Body>
70
70
  <Body type={Typography.BODY_LARGE} className="m-t-3">
71
- We’re building the world's{' '}
71
+ We’re building the worlds{' '}
72
72
  <a href="#" target="_blank">
73
73
  most international account
74
74
  </a>
75
- . We’re building the world's most international account
75
+ . We’re building the worlds most international account
76
76
  </Body>
77
77
  <Body type={Typography.BODY_DEFAULT_BOLD} className="m-t-3">
78
- We’re building the world's{' '}
78
+ We’re building the worlds{' '}
79
79
  <a href="#" target="_blank">
80
80
  most international account
81
81
  </a>
82
- . We’re building the world's most international account
82
+ . We’re building the worlds most international account
83
83
  </Body>
84
84
  <Body type={Typography.BODY_DEFAULT} className="m-t-3">
85
- We’re building the world's{' '}
85
+ We’re building the worlds{' '}
86
86
  <a href="#" target="_blank">
87
87
  most international account
88
88
  </a>
89
- . We’re building the world's most international account
89
+ . We’re building the worlds most international account
90
90
  </Body>
91
91
  </>
92
92
  );
@@ -54,7 +54,6 @@ const Loader = ({
54
54
  }
55
55
 
56
56
  return () => {
57
- // eslint-disable-next-line fp/no-mutation
58
57
  cancelled = true;
59
58
 
60
59
  clearTimeout(timeout);
package/src/logo/Logo.js CHANGED
@@ -42,8 +42,8 @@ const Logo = ({ className, inverse, type }) => {
42
42
  type === LogoType.WISE
43
43
  ? 'Wise'
44
44
  : 'Wise Business' | (type === LogoType.WISE_PLATFORM)
45
- ? 'Wise Platform'
46
- : 'Wise Business'
45
+ ? 'Wise Platform'
46
+ : 'Wise Business'
47
47
  }
48
48
  role="img"
49
49
  className={classNames(className, 'np-logo')}
package/src/main.css CHANGED
@@ -1857,6 +1857,11 @@ button.np-option {
1857
1857
  transition: opacity 150ms ease-in, height 150ms ease-in 150ms;
1858
1858
  opacity: 0;
1859
1859
  }
1860
+ .formatted-value__h3-custom-alignment {
1861
+ margin-bottom: 16px;
1862
+ margin-bottom: var(--size-16);
1863
+ line-height: 24px;
1864
+ }
1860
1865
  .emphasis {
1861
1866
  font-weight: 600;
1862
1867
  font-weight: var(--font-weight-semi-bold);
package/src/main.less CHANGED
@@ -22,6 +22,7 @@
22
22
  @import "./dimmer/Dimmer.less";
23
23
  @import "./drawer/Drawer.less";
24
24
  @import "./dropFade/DropFade.less";
25
+ @import "./dynamicFieldDefinitionList/FormattedValue/FormattedValue.less";
25
26
  @import "./emphasis/Emphasis.less";
26
27
  @import "./flowNavigation/animatedLabel/AnimatedLabel.less";
27
28
  @import "./flowNavigation/backButton/BackButton.less";
@@ -16,7 +16,7 @@ export default {
16
16
 
17
17
  return (
18
18
  <>
19
- <label htmlFor={args.id as string}>Editable money input label</label>
19
+ <label htmlFor={args.id}>Editable money input label</label>
20
20
  <MoneyInput
21
21
  {...args}
22
22
  selectedCurrency={selectedCurrency}
@@ -160,13 +160,13 @@ export const SmallInput: Story = {
160
160
  render: (args) => {
161
161
  return (
162
162
  <>
163
- <label htmlFor={args.id as string}>Money inputs</label>
163
+ <label htmlFor={args.id}>Money inputs</label>
164
164
  <MoneyInput {...args} {...SingleCurrency.args} />
165
165
  <br />
166
166
  <MoneyInput {...args} {...MultipleCurrencies.args} />
167
167
  <hr />
168
168
  <div className="has-error">
169
- <label htmlFor={args.id as string}>Error states</label>
169
+ <label htmlFor={args.id}>Error states</label>
170
170
  <MoneyInput {...args} {...SingleCurrency.args} />
171
171
  <br />
172
172
  <MoneyInput {...args} {...MultipleCurrencies.args} />
@@ -51,14 +51,14 @@ describe('Nudge', () => {
51
51
  });
52
52
 
53
53
  it('does NOT render a nudge if localStorage has been set with the id of the nudge', () => {
54
- jest.spyOn(window.localStorage.__proto__, 'getItem').mockReturnValue('["CAKE","TEST"]');
54
+ jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["CAKE","TEST"]');
55
55
 
56
56
  render(<Nudge {...defaultProps} id="TEST" persistDismissal />);
57
57
  expect(screen.queryByText('A nudge title')).not.toBeInTheDocument();
58
58
  });
59
59
 
60
60
  it('does NOT render a nudge if localStorage has been set with the id of the nudge AND calls is previously dismissed with TRUE', () => {
61
- jest.spyOn(window.localStorage.__proto__, 'getItem').mockReturnValue('["CAKE","TEST"]');
61
+ jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["CAKE","TEST"]');
62
62
  const isPreviouslyDismissed = jest.fn();
63
63
 
64
64
  render(
@@ -75,7 +75,7 @@ describe('Nudge', () => {
75
75
  });
76
76
 
77
77
  it('shows a nudge if localStorage has been set with a different id for a different nudge and calls is previously dismissed with FALSE', () => {
78
- jest.spyOn(window.localStorage.__proto__, 'getItem').mockReturnValue('["BANANA"]');
78
+ jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["BANANA"]');
79
79
  const isPreviouslyDismissed = jest.fn();
80
80
 
81
81
  render(
@@ -92,8 +92,8 @@ describe('Nudge', () => {
92
92
  });
93
93
 
94
94
  it('calls local storage with updated dismissed nudges value', () => {
95
- jest.spyOn(window.localStorage.__proto__, 'getItem').mockReturnValue('["BANANA"]');
96
- const setItem = jest.spyOn(window.localStorage.__proto__, 'setItem');
95
+ jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["BANANA"]');
96
+ const setItem = jest.spyOn(Storage.prototype, 'setItem');
97
97
 
98
98
  render(<Nudge {...defaultProps} id="TEST" persistDismissal />);
99
99
  expect(screen.getByText('A nudge title')).toBeInTheDocument();
@@ -110,7 +110,8 @@ const PhoneNumberInput = ({
110
110
 
111
111
  useEffect(() => {
112
112
  if (broadcastedValue === null) {
113
- return setBroadcastedValue(internalValue);
113
+ setBroadcastedValue(internalValue);
114
+ return;
114
115
  }
115
116
 
116
117
  const internalPhoneNumber = `${internalValue.prefix ?? ''}${internalValue.suffix}`;
@@ -1,3 +1,3 @@
1
- const DIGITS_MATCH = /^$|^(\+)|([\d]+)/g;
1
+ const DIGITS_MATCH = /^$|^(\+)|(\d+)/g;
2
2
 
3
3
  export const cleanNumber = (number: string) => number.match(DIGITS_MATCH)?.join('') ?? '';
@@ -38,8 +38,9 @@ function resolvePlacement(preferredPlacement: PopoverPreferredPlacement) {
38
38
  case 'bottom-left':
39
39
  case 'bottom-right':
40
40
  return 'bottom';
41
+ default:
42
+ return preferredPlacement;
41
43
  }
42
- return preferredPlacement;
43
44
  }
44
45
 
45
46
  export default function Popover({
@@ -298,7 +298,7 @@ const PromoCard: FunctionComponent<PromoCardProps> = forwardRef(
298
298
  ...commonProps,
299
299
  'aria-checked':
300
300
  type === 'radio' ? value === state : type === 'checkbox' ? checked : undefined,
301
- 'aria-describedby': `${componentId}-title` || undefined,
301
+ 'aria-describedby': `${componentId}-title`,
302
302
  'aria-disabled': isDisabled,
303
303
  'data-value': value ?? undefined,
304
304
  role: type === 'checkbox' || type === 'radio' ? type : undefined,
@@ -34,7 +34,7 @@ const RADIOS = [
34
34
 
35
35
  describe('RadioGroup', () => {
36
36
  it('renders null if no radios are provided', () => {
37
- expect(shallow(<RadioGroup radios={[]} {...props} />).toBeNully);
37
+ expect(shallow(<RadioGroup radios={[]} {...props} />).isEmptyRender()).toBe(true);
38
38
  });
39
39
 
40
40
  it('renders radio options', () => {
@@ -74,7 +74,8 @@ export const WithCards = () => {
74
74
 
75
75
  const handleOnCardClick = (index: number) => {
76
76
  if (expandedCardIndex === index) {
77
- return setExpandedCardIndex(null);
77
+ setExpandedCardIndex(null);
78
+ return;
78
79
  }
79
80
  setExpandedCardIndex(index);
80
81
  };
@@ -96,7 +96,7 @@ describe('SegmentedControl', () => {
96
96
 
97
97
  // new function is created on every render
98
98
  const onChange = () => {
99
- onChangeCallCount++;
99
+ onChangeCallCount += 1;
100
100
  simulateRerender({});
101
101
  };
102
102
 
@@ -118,7 +118,7 @@ describe('SegmentedControl', () => {
118
118
 
119
119
  // a new onChange function is created on every render
120
120
  const onChange = () => {
121
- onChangeCallCount++;
121
+ onChangeCallCount += 1;
122
122
  simulateRerender({});
123
123
  };
124
124
 
@@ -246,8 +246,8 @@ export default function Select({
246
246
  };
247
247
 
248
248
  function selectKeyboardFocusedOption() {
249
- if (keyboardFocusedOptionIndex != null) {
250
- selectableOptions.length > 0 && selectOption(selectableOptions[keyboardFocusedOptionIndex]);
249
+ if (keyboardFocusedOptionIndex != null && selectableOptions.length > 0) {
250
+ selectOption(selectableOptions[keyboardFocusedOptionIndex]);
251
251
  }
252
252
  }
253
253
 
@@ -511,7 +511,6 @@ export default function Select({
511
511
  disabled={disabled}
512
512
  aria-controls={listboxId}
513
513
  aria-expanded={open}
514
- aria-autocomplete="none"
515
514
  onClick={handleOnClick}
516
515
  {...buttonProps}
517
516
  >
@@ -1,6 +1,5 @@
1
1
  function supportsTouchEvents() {
2
2
  const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;
3
- // eslint-disable-next-line compat/compat
4
3
  const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;
5
4
  const documentTouchIsDefined =
6
5
  typeof window !== 'undefined' &&
@@ -21,7 +20,7 @@ function userAgentSuggestsTouchDevice() {
21
20
  'bada',
22
21
  ];
23
22
  const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');
24
- const regex = new RegExp(matchString, 'ig');
23
+ const regex = new RegExp(matchString, 'gi');
25
24
  return typeof navigator !== 'undefined' && !!navigator.userAgent.match(regex);
26
25
  }
27
26
  // Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
@@ -2,12 +2,17 @@ import { isTouchDevice } from './deviceDetection';
2
2
 
3
3
  describe('Device detection', () => {
4
4
  function fakeUserAgent(userAgent) {
5
- navigator.__defineGetter__('userAgent', () => userAgent);
6
- // need to use this instead of defineProperty, as it's blocked from overriding
5
+ Object.defineProperty(navigator, 'userAgent', {
6
+ value: userAgent,
7
+ configurable: true,
8
+ });
7
9
  }
8
10
 
9
11
  function fakeMaxTouchPoints(maxTouchPoints) {
10
- navigator.__defineGetter__('maxTouchPoints', () => maxTouchPoints);
12
+ Object.defineProperty(navigator, 'maxTouchPoints', {
13
+ value: maxTouchPoints,
14
+ configurable: true,
15
+ });
11
16
  }
12
17
 
13
18
  // We don't test DocumentTouch api as it's basically impossible to test :(
@@ -13,7 +13,7 @@ import en from '../i18n/en.json';
13
13
  */
14
14
  function customRender(ui, { locale = DEFAULT_LOCALE, messages = en, ...renderOptions } = {}) {
15
15
  // eslint-disable-next-line react/prop-types
16
- var Wrapper = ({ children }) => {
16
+ const Wrapper = ({ children }) => {
17
17
  return <Provider i18n={{ locale, messages }}>{children}</Provider>;
18
18
  };
19
19
  return render(ui, { wrapper: Wrapper, ...renderOptions });
@@ -30,7 +30,7 @@ interface StoryConfig {
30
30
 
31
31
  const getViewportWidth = (viewport: (typeof viewports)[keyof typeof viewports]) => {
32
32
  if (viewport.styles && typeof viewport.styles === 'object') {
33
- return parseInt(viewport.styles.width);
33
+ return Number.parseInt(viewport.styles.width, 10);
34
34
  }
35
35
  throw new Error('Unknown viewport styles');
36
36
  };
@@ -34,7 +34,7 @@ describe('Title', () => {
34
34
 
35
35
  it('handles unsupported typography type', () => {
36
36
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
37
- // @ts-ignore
37
+ // @ts-expect-error
38
38
  render(<Title type={Typography.BODY_LARGE_BOLD}>Test</Title>);
39
39
  const copy = screen.getByText('Test');
40
40
  expect(copy).toBeInTheDocument();
@@ -314,7 +314,9 @@ describe('Typeahead', () => {
314
314
  let selectedOption;
315
315
 
316
316
  component.setProps({
317
- onChange: (selections) => (selectedOption = selections[0]),
317
+ onChange: (selections) => {
318
+ selectedOption = selections[0];
319
+ },
318
320
  options: options,
319
321
  });
320
322
 
@@ -340,7 +342,7 @@ describe('Typeahead', () => {
340
342
  it('renders all options', () => {
341
343
  const options = option().map((optNode) => optNode.text());
342
344
  expect(options).toHaveLength(props.options.length);
343
- expect(options.every((label, i) => label === props.options[i].label));
345
+ expect(options.every((label, i) => label === props.options[i].label)).toBe(true);
344
346
  });
345
347
 
346
348
  it('does not render new option if showNewEntry is false', () => {
@@ -8,7 +8,7 @@ import Upload from '.';
8
8
 
9
9
  jest.useFakeTimers();
10
10
  jest.mock('./utils/postData', () => ({
11
- postData: () => new Promise((resolve) => resolve('ServerResponse')),
11
+ postData: async () => 'ServerResponse',
12
12
  }));
13
13
 
14
14
  jest.mock('./utils/asyncFileRead');
@@ -88,7 +88,7 @@ describe('Upload', () => {
88
88
  let component;
89
89
  beforeEach(() => {
90
90
  component = shallow(<Upload {...props} />).dive();
91
- asyncFileRead.mockImplementation(() => new Promise((resolve) => resolve('a value')));
91
+ asyncFileRead.mockImplementation(async () => 'a value');
92
92
  });
93
93
 
94
94
  afterEach(() => {
@@ -183,7 +183,9 @@ describe('Upload', () => {
183
183
  });
184
184
 
185
185
  it('step ProcessingStep is called with error props', async () => {
186
- asyncFileRead.mockImplementation(() => new Promise((resolve, reject) => reject('An error')));
186
+ asyncFileRead.mockImplementation(async () => {
187
+ throw 'An error';
188
+ });
187
189
 
188
190
  await component.instance().fileDropped(TEST_FILE);
189
191
  jest.advanceTimersByTime(props.animationDelay);
@@ -230,7 +232,9 @@ describe('Upload', () => {
230
232
  it('step CompleteStep is called with error props', async () => {
231
233
  component = mount(<Upload {...props} />);
232
234
  const upload = component.children();
233
- asyncFileRead.mockImplementation(() => new Promise((resolve, reject) => reject('An error')));
235
+ asyncFileRead.mockImplementation(async () => {
236
+ throw 'An error';
237
+ });
234
238
 
235
239
  await upload.instance().fileDropped(TEST_FILE);
236
240
  jest.advanceTimersByTime(props.animationDelay + ANIMATION_DELAY);
@@ -225,6 +225,7 @@ const UploadButton = ({
225
225
  data-testid={TEST_IDS.uploadInput}
226
226
  onChange={filesSelected}
227
227
  />
228
+ {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
228
229
  <label
229
230
  htmlFor={id}
230
231
  className={classNames('btn', 'np-upload-accent', 'np-upload-button', {