@transferwise/components 0.0.0-experimental-ae57ad1 → 0.0.0-experimental-d82182c
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
-
import {
|
|
3
|
+
import { fireEvent, within } from 'storybook/test';
|
|
4
4
|
import { lorem100, lorem500 } from '../../test-utils';
|
|
5
5
|
import { Typography } from '../propsValues/typography';
|
|
6
6
|
import Alert from '../../alert';
|
|
@@ -29,9 +29,12 @@ type Story = StoryObj<typeof BottomSheet>;
|
|
|
29
29
|
* This test ensures that when the SelectInput is used within a scrollable page,
|
|
30
30
|
* opening the dropdown does not cause any unwanted scrolling or layout shifts.
|
|
31
31
|
* Expected preview should start with green bar at the top, with yellow section
|
|
32
|
-
* not in the viewport.
|
|
32
|
+
* not in the viewport. The issue is particularly prominent on iOS Safari.
|
|
33
33
|
*
|
|
34
|
-
* NB: This test is disabled in Chromatic as there's no obvious way to control
|
|
34
|
+
* NB: This test is disabled in Chromatic as there's no obvious way to control
|
|
35
|
+
* <html/> element of a snapshot. It's to be primarily used in manual testing
|
|
36
|
+
* on an actual device or a simulator as it cannot be reproduced with mobile
|
|
37
|
+
* emulation modes on desktop browsers.
|
|
35
38
|
*/
|
|
36
39
|
export const SmoothScrollReset: Story = {
|
|
37
40
|
args: {
|
|
@@ -73,7 +76,8 @@ export const SmoothScrollReset: Story = {
|
|
|
73
76
|
document.documentElement.scrollTop = 400;
|
|
74
77
|
await wait(500);
|
|
75
78
|
const canvas = within(canvasElement);
|
|
76
|
-
|
|
79
|
+
// cannot use userEvent.click as it crashes on iOS Safari in the simulator
|
|
80
|
+
await fireEvent.click(canvas.getByRole('button'));
|
|
77
81
|
},
|
|
78
82
|
render: ({ open, ...args }) => {
|
|
79
83
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { fn, type Mock,
|
|
2
|
+
import { fireEvent, fn, type Mock, within } from 'storybook/test';
|
|
3
3
|
import { allModes } from '../../.storybook/modes';
|
|
4
4
|
import { lorem5, lorem500 } from '../test-utils';
|
|
5
5
|
import { Field } from '../field/Field';
|
|
@@ -30,9 +30,12 @@ const wait = async (duration = 500) =>
|
|
|
30
30
|
* This test ensures that when the SelectInput is used within a scrollable page,
|
|
31
31
|
* opening the dropdown does not cause any unwanted scrolling or layout shifts.
|
|
32
32
|
* Expected preview should start with green bar at the top, with yellow section
|
|
33
|
-
* not in the viewport.
|
|
33
|
+
* not in the viewport. The issue is particularly prominent on iOS Safari.
|
|
34
34
|
*
|
|
35
|
-
* NB: This test is disabled in Chromatic as there's no obvious way to control
|
|
35
|
+
* NB: This test is disabled in Chromatic as there's no obvious way to control
|
|
36
|
+
* <html/> element of a snapshot. It's to be primarily used in manual testing
|
|
37
|
+
* on an actual device or a simulator as it cannot be reproduced with mobile
|
|
38
|
+
* emulation modes on desktop browsers.
|
|
36
39
|
*/
|
|
37
40
|
export const SmoothScrollReset: Story<string> = {
|
|
38
41
|
args: {
|
|
@@ -69,8 +72,8 @@ export const SmoothScrollReset: Story<string> = {
|
|
|
69
72
|
document.documentElement.scrollTop = 400;
|
|
70
73
|
await wait();
|
|
71
74
|
const canvas = within(canvasElement);
|
|
72
|
-
|
|
73
|
-
await
|
|
75
|
+
// cannot use userEvent.click as it crashes on iOS Safari in the simulator
|
|
76
|
+
await fireEvent.click(canvas.getByRole('combobox'));
|
|
74
77
|
},
|
|
75
78
|
globals: {
|
|
76
79
|
viewport: { value: allModes.largeMobile.viewport, isRotated: false },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import {
|
|
2
|
+
import { within, fireEvent } from 'storybook/test';
|
|
3
3
|
import { allModes } from '../../.storybook/modes';
|
|
4
4
|
import { lorem500 } from '../test-utils';
|
|
5
5
|
import { Field } from '../field/Field';
|
|
@@ -54,9 +54,12 @@ const wait = async (duration = 500) =>
|
|
|
54
54
|
* This test ensures that when the SelectInput is used within a scrollable page,
|
|
55
55
|
* opening the dropdown does not cause any unwanted scrolling or layout shifts.
|
|
56
56
|
* Expected preview should start with green bar at the top, with yellow section
|
|
57
|
-
* not in the viewport.
|
|
57
|
+
* not in the viewport. The issue is particularly prominent on iOS Safari.
|
|
58
58
|
*
|
|
59
|
-
* NB: This test is disabled in Chromatic as there's no obvious way to control
|
|
59
|
+
* NB: This test is disabled in Chromatic as there's no obvious way to control
|
|
60
|
+
* <html/> element of a snapshot. It's to be primarily used in manual testing
|
|
61
|
+
* on an actual device or a simulator as it cannot be reproduced with mobile
|
|
62
|
+
* emulation modes on desktop browsers.
|
|
60
63
|
*/
|
|
61
64
|
export const SmoothScrollReset: Story = {
|
|
62
65
|
decorators: [
|
|
@@ -87,8 +90,8 @@ export const SmoothScrollReset: Story = {
|
|
|
87
90
|
document.documentElement.scrollTop = 400;
|
|
88
91
|
await wait();
|
|
89
92
|
const canvas = within(canvasElement);
|
|
90
|
-
|
|
91
|
-
await
|
|
93
|
+
// cannot use userEvent.click as it crashes on iOS Safari in the simulator
|
|
94
|
+
await fireEvent.click(canvas.getByRole('combobox'));
|
|
92
95
|
},
|
|
93
96
|
globals: {
|
|
94
97
|
viewport: { value: allModes.largeMobile.viewport, isRotated: false },
|