@transferwise/components 0.0.0-experimental-5ca6e74 → 0.0.0-experimental-c132c7d

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
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-5ca6e74",
3
+ "version": "0.0.0-experimental-c132c7d",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -83,8 +83,8 @@
83
83
  "storybook": "^9.1.3",
84
84
  "storybook-addon-tag-badges": "^2.0.2",
85
85
  "storybook-addon-test-codegen": "^2.0.1",
86
- "@transferwise/less-config": "3.1.2",
87
86
  "@transferwise/neptune-css": "14.25.0",
87
+ "@transferwise/less-config": "3.1.2",
88
88
  "@wise/components-theming": "1.7.0",
89
89
  "@wise/wds-configs": "0.0.0"
90
90
  },
@@ -6,6 +6,7 @@ import { SelectInput, type SelectInputProps } from './SelectInput';
6
6
  import { lorem5, lorem500 } from '../test-utils';
7
7
  import Body from '../body';
8
8
  import { allModes } from '../../.storybook/modes';
9
+ import { MINIMAL_VIEWPORTS } from 'storybook/viewport';
9
10
 
10
11
  const meta = {
11
12
  title: 'Forms/SelectInput/tests',
@@ -30,8 +31,9 @@ const wait = async (duration = 1000) =>
30
31
  /**
31
32
  * This test ensures that when the SelectInput is used within a scrollable page,
32
33
  * opening the dropdown does not cause any unwanted scrolling or layout shifts.
33
- * Expected snapshot should start with green bar at the top, with yellow section
34
- * not in the viewport
34
+ * Expected preview should start with green bar at the top, with yellow section
35
+ * not in the viewport.
36
+ * NB: This test is disabled in Chromatic as there's no known way to scroll position.
35
37
  */
36
38
  export const SmoothScrollReset: Story<string> = {
37
39
  args: {
@@ -44,16 +46,15 @@ export const SmoothScrollReset: Story<string> = {
44
46
  decorators: [
45
47
  (Story) => (
46
48
  <>
47
- <style>{`html { scroll-behavior: smooth; }`}</style>
48
- <a href="#anchor">Jump to SelectInput</a>
49
- <div style={{ maxWidth: 400 }}>
49
+
50
+ <div style={{ ...MINIMAL_VIEWPORTS.mobile2.styles, overflow: 'scroll' }}>
50
51
  <div
51
52
  className="d-flex align-items-center justify-content-center"
52
53
  style={{ height: 400, backgroundColor: 'var(--color-bright-yellow)' }}
53
54
  >
54
- This block should not be visible on a snapshot
55
+ This block should not be in the viewport.
55
56
  </div>
56
- <div id="anchor" style={{ height: 10, backgroundColor: 'var(--color-bright-green)' }} />
57
+ <div style={{ height: 10, backgroundColor: 'var(--color-bright-green)' }} />
57
58
  <Field id="el1" label={lorem5}>
58
59
  <Story />
59
60
  </Field>
@@ -63,18 +64,10 @@ export const SmoothScrollReset: Story<string> = {
63
64
  ),
64
65
  ],
65
66
  play: async ({ canvasElement }) => {
66
- document.documentElement.style.scrollBehavior = 'unset';
67
- await wait(100);
68
-
67
+ document.documentElement.scrollTop = 400;
69
68
  const canvas = within(canvasElement);
70
- await userEvent.click(canvas.getByRole('link'));
71
-
72
- await wait(750);
73
- document.documentElement.style.removeProperty('scroll-behavior');
74
- await wait(100);
75
-
76
69
  const triggerButton = canvas.getByRole('combobox');
77
- await userEvent.click(triggerButton);
70
+ //await userEvent.click(triggerButton);
78
71
  },
79
72
  globals: {
80
73
  viewport: { value: allModes.largeMobile.viewport, isRotated: false },