@transferwise/components 0.0.0-experimental-40b5678 → 0.0.0-experimental-6ad430a

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 (44) hide show
  1. package/package.json +8 -7
  2. package/src/accordion/Accordion.spec.js +5 -5
  3. package/src/accordion/AccordionItem/AccordionItem.spec.js +2 -2
  4. package/src/actionButton/ActionButton.spec.tsx +5 -4
  5. package/src/alert/Alert.spec.tsx +4 -4
  6. package/src/button/Button.spec.js +5 -4
  7. package/src/card/Card.spec.tsx +4 -4
  8. package/src/carousel/Carousel.spec.tsx +17 -17
  9. package/src/checkbox/Checkbox.spec.tsx +2 -0
  10. package/src/checkboxButton/CheckboxButton.spec.tsx +2 -0
  11. package/src/checkboxOption/CheckboxOption.spec.tsx +2 -0
  12. package/src/chevron/Chevron.spec.tsx +1 -0
  13. package/src/chips/Chips.spec.tsx +1 -0
  14. package/src/circularButton/CircularButton.spec.tsx +5 -4
  15. package/src/common/RadioButton/RadioButton.spec.tsx +2 -2
  16. package/src/common/closeButton/CloseButton.spec.tsx +1 -0
  17. package/src/common/flowHeader/FlowHeader.spec.tsx +1 -0
  18. package/src/dateLookup/DateLookup.rtl.spec.tsx +16 -18
  19. package/src/dateLookup/DateLookup.testingLibrary.spec.js +44 -47
  20. package/src/decision/Decision.spec.js +2 -0
  21. package/src/dimmer/Dimmer.rtl.spec.js +10 -10
  22. package/src/drawer/Drawer.rtl.spec.tsx +2 -2
  23. package/src/emphasis/Emphasis.spec.tsx +1 -0
  24. package/src/field/Field.spec.tsx +2 -2
  25. package/src/flowNavigation/FlowNavigation.spec.js +2 -0
  26. package/src/flowNavigation/animatedLabel/AnimatedLabel.spec.js +1 -0
  27. package/src/header/Header.spec.tsx +6 -6
  28. package/src/image/Image.spec.tsx +1 -0
  29. package/src/inlineAlert/InlineAlert.spec.tsx +1 -0
  30. package/src/inputs/SelectInput.spec.tsx +47 -26
  31. package/src/link/Link.spec.tsx +1 -0
  32. package/src/listItem/ListItem.spec.tsx +1 -0
  33. package/src/moneyInput/MoneyInput.rtl.spec.tsx +2 -2
  34. package/src/popover/Popover.spec.tsx +10 -10
  35. package/src/progress/Progress.spec.tsx +1 -0
  36. package/src/progressBar/ProgressBar.spec.tsx +1 -0
  37. package/src/segmentedControl/SegmentedControl.spec.tsx +11 -10
  38. package/src/select/Select.spec.js +71 -71
  39. package/src/test-utils/index.js +1 -1
  40. package/src/test-utils/jest.setup.js +0 -2
  41. package/src/tooltip/Tooltip.spec.tsx +16 -15
  42. package/src/uploadInput/UploadInput.spec.tsx +10 -9
  43. package/src/uploadInput/uploadButton/UploadButton.spec.tsx +4 -4
  44. package/src/uploadInput/uploadItem/UploadItem.spec.tsx +4 -4
@@ -1,4 +1,5 @@
1
- import { userEvent } from '@testing-library/user-event';
1
+ import '@testing-library/jest-dom';
2
+ import user from '@testing-library/user-event';
2
3
  import { act } from 'react';
3
4
 
4
5
  import { render, screen, mockMatchMedia } from '../test-utils';
@@ -54,103 +55,103 @@ describe('DateLookup (events)', () => {
54
55
 
55
56
  it('switches to years', async () => {
56
57
  const view = await setup();
57
- await openDateLookup(view);
58
- await clickDateButton(view);
58
+ openDateLookup(view);
59
+ clickDateButton(view);
59
60
 
60
61
  expect(getActiveYearButton(view)).toHaveFocus();
61
62
 
62
- await closeDateLookup(view);
63
+ closeDateLookup(view);
63
64
  });
64
65
 
65
66
  it('has aria-label for 20 years', async () => {
66
67
  const view = await setup();
67
- await openDateLookup(view);
68
- await clickDateButton(view);
68
+ openDateLookup(view);
69
+ clickDateButton(view);
69
70
 
70
71
  expect(getButtonByAriaLabel('next 20 years')).toBeInTheDocument();
71
72
  expect(getButtonByAriaLabel('previous 20 years')).toBeInTheDocument();
72
73
 
73
- await closeDateLookup(view);
74
+ closeDateLookup(view);
74
75
  });
75
76
 
76
77
  it('switches to months', async () => {
77
78
  const view = await setup();
78
- await openDateLookup(view);
79
- await clickDateButton(view);
80
- await userEvent.click(getActiveYearButton(view));
79
+ openDateLookup(view);
80
+ clickDateButton(view);
81
+ user.click(getActiveYearButton(view));
81
82
 
82
83
  expect(getActiveMonthButton(view)).toHaveFocus();
83
84
 
84
- await closeDateLookup(view);
85
+ closeDateLookup(view);
85
86
  });
86
87
 
87
88
  it('has aria label for year', async () => {
88
89
  const view = await setup();
89
- await openDateLookup(view);
90
- await clickDateButton(view);
91
- await userEvent.click(getActiveYearButton(view));
90
+ openDateLookup(view);
91
+ clickDateButton(view);
92
+ user.click(getActiveYearButton(view));
92
93
 
93
94
  expect(getButtonByAriaLabel('next year')).toBeInTheDocument();
94
95
  expect(getButtonByAriaLabel('previous year')).toBeInTheDocument();
95
96
 
96
- await closeDateLookup(view);
97
+ closeDateLookup(view);
97
98
  });
98
99
 
99
100
  it('switches to days', async () => {
100
101
  const view = await setup();
101
- await openDateLookup(view);
102
- await clickDateButton(view);
103
- await userEvent.click(getActiveYearButton(view));
104
- await userEvent.click(getActiveMonthButton(view));
102
+ openDateLookup(view);
103
+ clickDateButton(view);
104
+ user.click(getActiveYearButton(view));
105
+ user.click(getActiveMonthButton(view));
105
106
 
106
107
  expect(getActiveDayButton(view)).toHaveFocus();
107
108
 
108
- await closeDateLookup(view);
109
+ closeDateLookup(view);
109
110
  });
110
111
 
111
112
  it('has aria label for month', async () => {
112
113
  const view = await setup();
113
- await openDateLookup(view);
114
- await clickDateButton(view);
115
- await userEvent.click(getActiveYearButton(view));
116
- await userEvent.click(getActiveMonthButton(view));
114
+ openDateLookup(view);
115
+ clickDateButton(view);
116
+ user.click(getActiveYearButton(view));
117
+ user.click(getActiveMonthButton(view));
117
118
 
118
119
  expect(getButtonByAriaLabel('next month')).toBeInTheDocument();
119
120
  expect(getButtonByAriaLabel('previous month')).toBeInTheDocument();
120
121
 
121
- await closeDateLookup(view);
122
+ closeDateLookup(view);
122
123
  });
123
124
 
124
125
  it('updates selected date and closes', async () => {
125
126
  const view = await setup();
126
- await openDateLookup(view);
127
+ openDateLookup(view);
127
128
  const d = new Date(2018, 11, 28);
128
129
  const newDay = screen.getByText(d.getDate().toString());
129
- await userEvent.click(newDay);
130
+ user.click(newDay);
130
131
 
131
132
  expect(handleChange).toHaveBeenCalledWith(d);
132
133
  expect(getOpenButton(view)).toHaveFocus();
133
134
 
134
- await closeDateLookup(view);
135
+ closeDateLookup(view);
135
136
  });
136
137
 
137
138
  it('has aria label on selected date', async () => {
138
139
  const view = await setup();
139
- await openDateLookup(view);
140
+ openDateLookup(view);
140
141
  const d = new Date(2018, 11, 28);
141
142
  const newDay = screen.getByText(d.getDate().toString());
142
- await userEvent.click(newDay);
143
- await openDateLookup(view);
143
+ user.click(newDay);
144
+ openDateLookup(view);
144
145
  expect(screen.getByRole('button', { name: /selected day/i })).toBeInTheDocument();
145
146
 
146
- await closeDateLookup(view);
147
+ closeDateLookup(view);
147
148
  });
148
149
 
149
150
  it('supports custom `aria-labelledby` attribute', async () => {
150
151
  const view = await setup();
151
152
  expect(screen.getByLabelText('Prioritized label')).toHaveClass('input-group');
152
153
 
153
- await closeDateLookup(view);
154
+ closeDateLookup(view);
154
155
  });
155
156
  });
156
157
 
@@ -182,33 +183,29 @@ describe('DateLookup (events)', () => {
182
183
 
183
184
  it('when user clicks on clear the focus returns to btn', async () => {
184
185
  const view = await setup();
185
- await clickClearButton(view);
186
+ clickClearButton(view);
186
187
  expect(getOpenButton(view)).toHaveFocus();
187
188
  });
188
189
 
189
190
  it('onChange gets called with null when reset button is clicked', async () => {
190
191
  const view = await setup();
191
- await clickClearButton(view);
192
+ clickClearButton(view);
192
193
  expect(props.onChange).toHaveBeenCalledWith(null);
193
194
  });
194
195
  });
195
196
 
196
- const openDateLookup = async (
197
- /** @type {import('@testing-library/react').RenderResult} */ view,
198
- ) => userEvent.click(getOpenButton(view));
197
+ const openDateLookup = (/** @type {import('@testing-library/react').RenderResult} */ view) =>
198
+ user.click(getOpenButton(view));
199
199
 
200
- const clickDateButton = async (
201
- /** @type {import('@testing-library/react').RenderResult} */ view,
202
- ) => userEvent.click(getDateButton(view));
200
+ const clickDateButton = (/** @type {import('@testing-library/react').RenderResult} */ view) =>
201
+ user.click(getDateButton(view));
203
202
 
204
203
  // Close dateLookup and removes events attached to documents.
205
- const closeDateLookup = async (
206
- /** @type {import('@testing-library/react').RenderResult} */ view,
207
- ) => userEvent.click(view.container);
204
+ const closeDateLookup = (/** @type {import('@testing-library/react').RenderResult} */ view) =>
205
+ user.click(view.container);
208
206
 
209
- const clickClearButton = async (
210
- /** @type {import('@testing-library/react').RenderResult} */ view,
211
- ) => userEvent.click(getClearButton(view));
207
+ const clickClearButton = (/** @type {import('@testing-library/react').RenderResult} */ view) =>
208
+ user.click(getClearButton(view));
212
209
 
213
210
  const getActiveYearButton = (
214
211
  /** @type {import('@testing-library/react').RenderResult} */ view,
@@ -1,3 +1,5 @@
1
+ import '@testing-library/jest-dom';
2
+
1
3
  import Avatar from '../avatar';
2
4
  import { Breakpoint, Size } from '../common';
3
5
  import { mockMatchMedia } from '../mocks';
@@ -25,42 +25,42 @@ describe('Dimmer', () => {
25
25
  });
26
26
 
27
27
  describe('closing behaviour', () => {
28
- it('calls onClose if the dimmer is clicked', async () => {
28
+ it('calls onClose if the dimmer is clicked', () => {
29
29
  const onClose = jest.fn();
30
30
  render(<Dimmer {...props} onClose={onClose} />);
31
- await userEvent.click(screen.getByRole('presentation'));
31
+ userEvent.click(screen.getByRole('presentation'));
32
32
  expect(onClose).toHaveBeenCalledTimes(1);
33
33
  });
34
34
 
35
- it('does not call onClose if the dimmer content is clicked', async () => {
35
+ it('does not call onClose if the dimmer content is clicked', () => {
36
36
  const onClose = jest.fn();
37
37
  render(
38
38
  <Dimmer {...props} onClose={onClose}>
39
39
  <Button onClick={() => {}}>McClicky</Button>
40
40
  </Dimmer>,
41
41
  );
42
- await userEvent.click(screen.getByRole('button'));
42
+ userEvent.click(screen.getByRole('button'));
43
43
  expect(onClose).toHaveBeenCalledTimes(0);
44
44
  });
45
45
 
46
- it('does not call onClose when clicked if disableClickToClose is true', async () => {
46
+ it('does not call onClose when clicked if disableClickToClose is true', () => {
47
47
  const onClose = jest.fn();
48
48
  render(<Dimmer {...props} disableClickToClose onClose={onClose} />);
49
- await userEvent.click(screen.getByRole('presentation'));
49
+ userEvent.click(screen.getByRole('presentation'));
50
50
  expect(onClose).toHaveBeenCalledTimes(0);
51
51
  });
52
52
 
53
- it('calls onClose if the escape key is pressed', async () => {
53
+ it('calls onClose if the escape key is pressed', () => {
54
54
  const onClose = jest.fn();
55
55
  render(<Dimmer {...props} onClose={onClose} />);
56
- await userEvent.keyboard('{Escape}');
56
+ userEvent.keyboard('{esc}');
57
57
  expect(onClose).toHaveBeenCalledTimes(1);
58
58
  });
59
59
 
60
- it('does not call onClose if the escape key is pressed when disableClickToClose is true', async () => {
60
+ it('does not call onClose if the escape key is pressed when disableClickToClose is true', () => {
61
61
  const onClose = jest.fn();
62
62
  render(<Dimmer {...props} disableClickToClose onClose={onClose} />);
63
- await userEvent.keyboard('{Escape}');
63
+ userEvent.keyboard('{esc}');
64
64
  expect(onClose).toHaveBeenCalledTimes(1);
65
65
  });
66
66
  });
@@ -48,10 +48,10 @@ describe('Drawer', () => {
48
48
  expect(container).toMatchSnapshot();
49
49
  });
50
50
 
51
- it('calls onClose when user clicks close button', async () => {
51
+ it('calls onClose when user clicks close button', () => {
52
52
  render(<Drawer {...props}>content</Drawer>);
53
53
  expect(props.onClose).not.toHaveBeenCalled();
54
- await userEvent.click(getCloseButton());
54
+ userEvent.click(getCloseButton());
55
55
  expect(props.onClose).toHaveBeenCalledTimes(1);
56
56
  });
57
57
 
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import { render } from '../test-utils';
2
3
 
3
4
  import Emphasis from './Emphasis';
@@ -73,7 +73,7 @@ describe('Field', () => {
73
73
  button.addEventListener('click', handleClick);
74
74
 
75
75
  const label = screen.getByText('Phone number');
76
- await userEvent.click(label);
76
+ userEvent.click(label);
77
77
 
78
78
  expect(handleClick).not.toHaveBeenCalled();
79
79
  });
@@ -90,6 +90,6 @@ describe('Field', () => {
90
90
  expect(screen.getByRole('textbox')).not.toHaveAttribute('id');
91
91
 
92
92
  const label = screen.getByText('Phone number');
93
- await userEvent.click(label);
93
+ userEvent.click(label);
94
94
  });
95
95
  });
@@ -1,3 +1,5 @@
1
+ import '@testing-library/jest-dom';
2
+
1
3
  import Avatar, { AvatarType } from '../avatar';
2
4
  import { Breakpoint, Size } from '../common';
3
5
  import { mockMatchMedia, render, screen } from '../test-utils';
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import { render, screen } from '../../test-utils';
2
3
 
3
4
  import AnimatedLabel from '.';
@@ -9,7 +9,7 @@ describe('Header', () => {
9
9
  expect(screen.getByText('Header title')).toBeInTheDocument();
10
10
  });
11
11
 
12
- it('can trigger header action', async () => {
12
+ it('can trigger header action', () => {
13
13
  const onHeaderActionClick = jest.fn();
14
14
 
15
15
  render(
@@ -22,12 +22,12 @@ describe('Header', () => {
22
22
  />,
23
23
  );
24
24
 
25
- await userEvent.click(screen.getByRole('button', { name: 'Click me!' }));
25
+ userEvent.click(screen.getByRole('button', { name: 'Click me!' }));
26
26
 
27
27
  expect(onHeaderActionClick).toHaveBeenCalledTimes(1);
28
28
  });
29
29
 
30
- it('can set aria-label property for header action', async () => {
30
+ it('can set aria-label property for header action', () => {
31
31
  const onHeaderActionClick = jest.fn();
32
32
 
33
33
  render(
@@ -41,7 +41,7 @@ describe('Header', () => {
41
41
  />,
42
42
  );
43
43
 
44
- await userEvent.click(screen.getByRole('button', { name: 'Magic' }));
44
+ userEvent.click(screen.getByRole('button', { name: 'Magic' }));
45
45
 
46
46
  expect(onHeaderActionClick).toHaveBeenCalledTimes(1);
47
47
  });
@@ -75,7 +75,7 @@ describe('Header', () => {
75
75
  expect(screen.getByRole('heading', { name: 'Header title', level: 3 })).toBeInTheDocument();
76
76
  });
77
77
 
78
- it('runs onClick if specified even when it got href prop', async () => {
78
+ it('runs onClick if specified even when it got href prop', () => {
79
79
  const callback = jest.fn();
80
80
  render(
81
81
  <Header
@@ -88,7 +88,7 @@ describe('Header', () => {
88
88
  const button = screen.getByRole('link', { name: 'Click me' });
89
89
  expect(button).toBeInTheDocument();
90
90
 
91
- await userEvent.click(button);
91
+ userEvent.click(button);
92
92
 
93
93
  expect(callback).toHaveBeenCalledTimes(1);
94
94
  });
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import * as useHasIntersectedUtils from '../common/hooks/useHasIntersected/useHasIntersected';
2
3
  import { render, fireEvent, screen } from '../test-utils';
3
4
 
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable no-console */
2
+ import '@testing-library/jest-dom';
2
3
  import { Sentiment } from '../common';
3
4
  import { render, screen } from '../test-utils';
4
5
 
@@ -1,5 +1,5 @@
1
- import { screen, waitFor, within } from '@testing-library/react';
2
- import { userEvent } from '@testing-library/user-event';
1
+ import { act, screen, waitFor, within } from '@testing-library/react';
2
+ import userEvent from '@testing-library/user-event';
3
3
 
4
4
  import { render, mockMatchMedia, mockResizeObserver } from '../test-utils';
5
5
 
@@ -42,22 +42,25 @@ describe('SelectInput', () => {
42
42
  />,
43
43
  );
44
44
 
45
- await userEvent.tab();
46
- await userEvent.keyboard(' ');
45
+ // eslint-disable-next-line @typescript-eslint/require-await
46
+ await act(async () => {
47
+ userEvent.tab();
48
+ userEvent.keyboard(' ');
49
+ });
47
50
 
48
51
  const footer = screen.getByText('All items shown');
49
52
  expect(footer).toBeInTheDocument();
50
53
 
51
- await userEvent.keyboard('u');
54
+ userEvent.keyboard('u');
52
55
  expect(footer).toHaveTextContent(/‘u’$/);
53
56
 
54
- await userEvent.keyboard('r');
57
+ userEvent.keyboard('r');
55
58
  expect(footer).toHaveTextContent(/‘ur’$/);
56
59
 
57
- await userEvent.keyboard('x');
60
+ userEvent.keyboard('x');
58
61
  expect(footer).toHaveTextContent(/‘urx’$/);
59
62
 
60
- await userEvent.keyboard('{Backspace}');
63
+ userEvent.keyboard('{Backspace}');
61
64
  expect(footer).toHaveTextContent(/‘ur’$/);
62
65
  });
63
66
 
@@ -77,13 +80,16 @@ describe('SelectInput', () => {
77
80
  expect(screen.queryByText('EUR')).not.toBeInTheDocument();
78
81
 
79
82
  const trigger = screen.getAllByRole('button')[0];
80
- await userEvent.click(trigger);
83
+ // eslint-disable-next-line @typescript-eslint/require-await
84
+ await act(async () => {
85
+ userEvent.click(trigger);
86
+ });
81
87
 
82
88
  expect(handleClose).not.toHaveBeenCalled();
83
89
 
84
90
  const listbox = screen.getByRole('listbox');
85
91
  const option = within(listbox).getByRole('option', { name: 'EUR' });
86
- await userEvent.click(option);
92
+ userEvent.click(option);
87
93
 
88
94
  expect(handleClose).toHaveBeenCalledTimes(1);
89
95
  expect(trigger).toHaveTextContent('EUR');
@@ -111,28 +117,34 @@ describe('SelectInput', () => {
111
117
  );
112
118
 
113
119
  const trigger = screen.getAllByRole('button')[0];
114
- await userEvent.tab();
115
- await userEvent.keyboard(' ');
120
+ // eslint-disable-next-line @typescript-eslint/require-await
121
+ await act(async () => {
122
+ userEvent.tab();
123
+ userEvent.keyboard(' ');
124
+ });
116
125
 
117
126
  expect(handleClose).not.toHaveBeenCalled();
118
127
 
119
128
  const listbox = screen.getByRole('listbox');
120
129
  expect(within(listbox).getAllByRole('option')).toHaveLength(3);
121
130
 
122
- await userEvent.keyboard('u');
131
+ userEvent.keyboard('u');
123
132
  expect(within(listbox).getAllByRole('option')).toHaveLength(2);
124
133
 
125
- await userEvent.keyboard('r');
134
+ userEvent.keyboard('r');
126
135
  expect(within(listbox).getByRole('option')).toBeInTheDocument();
127
136
 
128
- await userEvent.keyboard('x');
137
+ userEvent.keyboard('x');
129
138
  expect(within(listbox).queryByRole('option')).not.toBeInTheDocument();
130
139
 
131
- await userEvent.keyboard('{Backspace}');
140
+ userEvent.keyboard('{Backspace}');
132
141
  expect(within(listbox).getByRole('option')).toBeInTheDocument();
133
142
 
134
143
  const option = within(listbox).getAllByRole('option')[0];
135
- await userEvent.click(option);
144
+ // eslint-disable-next-line @typescript-eslint/require-await
145
+ await act(async () => {
146
+ userEvent.click(option);
147
+ });
136
148
 
137
149
  expect(handleClose).toHaveBeenCalledTimes(1);
138
150
  expect(trigger).toHaveTextContent('EUR');
@@ -153,18 +165,21 @@ describe('SelectInput', () => {
153
165
  );
154
166
 
155
167
  const trigger = screen.getAllByRole('button')[0];
156
- await userEvent.tab();
157
- await userEvent.keyboard(' ');
168
+ // eslint-disable-next-line @typescript-eslint/require-await
169
+ await act(async () => {
170
+ userEvent.tab();
171
+ userEvent.keyboard(' ');
172
+ });
158
173
 
159
174
  expect(handleFilterChange).not.toHaveBeenCalled();
160
175
 
161
- await userEvent.keyboard(' x');
176
+ userEvent.keyboard(' x');
162
177
  expect(handleFilterChange).toHaveBeenLastCalledWith({
163
178
  query: ' x',
164
179
  queryNormalized: 'x',
165
180
  });
166
181
 
167
- await userEvent.keyboard('{Escape}');
182
+ userEvent.keyboard('{Escape}');
168
183
  await waitFor(() => {
169
184
  expect(handleFilterChange).toHaveBeenLastCalledWith({
170
185
  query: '',
@@ -172,7 +187,10 @@ describe('SelectInput', () => {
172
187
  });
173
188
  });
174
189
 
175
- await userEvent.click(trigger);
190
+ // eslint-disable-next-line @typescript-eslint/require-await
191
+ await act(async () => {
192
+ userEvent.click(trigger);
193
+ });
176
194
 
177
195
  const listbox = screen.getByRole('listbox');
178
196
  expect(within(listbox).getAllByRole('option')).toHaveLength(2);
@@ -190,13 +208,16 @@ describe('SelectInput', () => {
190
208
  );
191
209
 
192
210
  const trigger = screen.getAllByRole('button')[0];
193
- await userEvent.click(trigger);
211
+ // eslint-disable-next-line @typescript-eslint/require-await
212
+ await act(async () => {
213
+ userEvent.click(trigger);
214
+ });
194
215
 
195
216
  const listbox = screen.getByRole('listbox');
196
217
  const options = within(listbox).getAllByRole('option');
197
- for (const option of options) {
198
- await userEvent.click(option);
199
- }
218
+ options.forEach((option) => {
219
+ userEvent.click(option);
220
+ });
200
221
 
201
222
  expect(trigger).toHaveTextContent('USD, EUR');
202
223
  });
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import { render, screen } from '../test-utils';
2
3
 
3
4
  import Link from '.';
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import ActionButton from '../actionButton/ActionButton';
2
3
  import { render, screen, within } from '../test-utils';
3
4
 
@@ -62,11 +62,11 @@ describe('MoneyInput', () => {
62
62
  ['1±!@#$^*,_+?><2', '1,2'],
63
63
  ['12,3', '12,3'],
64
64
  ['12.3', '12.3'],
65
- ])("ignores the letters when typed '%s' and shows '%s'", async (testValue, expectedValue) => {
65
+ ])("ignores the letters when typed '%s' and shows '%s'", (testValue, expectedValue) => {
66
66
  render(<MoneyInput {...props} amount={null} />);
67
67
 
68
68
  const input = screen.getByRole('textbox');
69
- await userEvent.type(input, testValue);
69
+ userEvent.type(input, testValue);
70
70
  expect(input).toHaveValue(expectedValue);
71
71
  });
72
72
 
@@ -29,7 +29,7 @@ describe('Popover', () => {
29
29
  </Popover>,
30
30
  );
31
31
 
32
- await userEvent.click(screen.getByText('Open'));
32
+ userEvent.click(screen.getByText('Open'));
33
33
 
34
34
  await waitForPanel();
35
35
  expect(getPanel()).toMatchSnapshot();
@@ -42,7 +42,7 @@ describe('Popover', () => {
42
42
  </Popover>,
43
43
  ));
44
44
 
45
- await userEvent.click(screen.getByText('Open'));
45
+ userEvent.click(screen.getByText('Open'));
46
46
  await waitForPanel();
47
47
 
48
48
  expect(getTitle()).toBeInTheDocument();
@@ -53,7 +53,7 @@ describe('Popover', () => {
53
53
  </Popover>,
54
54
  );
55
55
 
56
- await userEvent.click(screen.getByText('Open'));
56
+ userEvent.click(screen.getByText('Open'));
57
57
 
58
58
  expect(getTitle()).not.toBeInTheDocument();
59
59
  });
@@ -67,7 +67,7 @@ describe('Popover', () => {
67
67
 
68
68
  expect(getPanel()).not.toBeInTheDocument();
69
69
 
70
- await userEvent.click(screen.getByText('Open'));
70
+ userEvent.click(screen.getByText('Open'));
71
71
  await waitForPanel();
72
72
 
73
73
  expect(getPanel()).toBeInTheDocument();
@@ -79,19 +79,19 @@ describe('Popover', () => {
79
79
  global.innerWidth = Breakpoint.SMALL - 1;
80
80
  });
81
81
 
82
- it('renders when is open', async () => {
82
+ it('renders when is open', () => {
83
83
  ({ container } = render(
84
84
  <Popover {...props}>
85
85
  <button type="button">Open</button>
86
86
  </Popover>,
87
87
  ));
88
88
 
89
- await userEvent.click(screen.getByText('Open'));
89
+ userEvent.click(screen.getByText('Open'));
90
90
 
91
91
  expect(container).toMatchSnapshot();
92
92
  });
93
93
 
94
- it('renders BottomSheet onClick', async () => {
94
+ it('renders BottomSheet onClick', () => {
95
95
  render(
96
96
  <Popover {...props}>
97
97
  <button type="button">Open</button>
@@ -100,7 +100,7 @@ describe('Popover', () => {
100
100
 
101
101
  expect(getBottomSheet()).not.toBeInTheDocument();
102
102
 
103
- await userEvent.click(screen.getByText('Open'));
103
+ userEvent.click(screen.getByText('Open'));
104
104
 
105
105
  expect(getBottomSheet()).toBeInTheDocument();
106
106
  });
@@ -115,11 +115,11 @@ describe('Popover', () => {
115
115
  );
116
116
 
117
117
  expect(handleOnClose).not.toHaveBeenCalled();
118
- await userEvent.click(screen.getByText('Open'));
118
+ userEvent.click(screen.getByText('Open'));
119
119
  await waitForPanel();
120
120
  const dimmer = getDimmer();
121
121
  if (dimmer != null) {
122
- await userEvent.click(dimmer);
122
+ userEvent.click(dimmer);
123
123
  }
124
124
  expect(handleOnClose).toHaveBeenCalledTimes(1);
125
125
  });
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import { render } from '../test-utils';
2
3
 
3
4
  import Progress from '.';
@@ -1,3 +1,4 @@
1
+ import '@testing-library/jest-dom';
1
2
  import { render, screen } from '../test-utils';
2
3
 
3
4
  import ProgressBar from './ProgressBar';