Skip to content

Commit 2e78315

Browse files
authored
Merge pull request #7346 from Sage/FE-7237_storybook-play-functions-installation
chore(storybook): install addon interactions, test and pseudo packages
2 parents a854f72 + f7bc9ce commit 2e78315

File tree

7 files changed

+6109
-8604
lines changed

7 files changed

+6109
-8604
lines changed

.storybook/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const config: StorybookConfig = {
4848
},
4949
},
5050
},
51+
"@storybook/addon-interactions",
52+
"storybook-addon-pseudo-states",
5153
"@storybook/addon-toolbars",
5254
"@storybook/addon-viewport",
5355
"@chromatic-com/storybook",

.storybook/preview.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Preview } from "@storybook/react";
2+
import { configure } from "@storybook/test";
23

34
import "../src/style/fonts.css";
45

@@ -9,6 +10,9 @@ import withLocaleSelector from "./with-locale-selector";
910
import withPortalProvider from "./with-portal-provider";
1011
import { withThemeProvider, globalThemeProvider } from "./withThemeProvider";
1112

13+
// Configure the testIdAttribute to look for data-role when querying elements using `getByTestId`.
14+
configure({ testIdAttribute: "data-role" });
15+
1216
const customViewports = {
1317
xsm: { name: "Extra small", styles: { width: "320px", height: "900px" } },
1418
sm: { name: "Small", styles: { width: "640px", height: "900px" } },
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Function to mimic how a user would pause between interactions
2+
function userInteractionPause(ms: number) {
3+
return new Promise((resolve) => setTimeout(resolve, ms));
4+
}
5+
6+
export default userInteractionPause;

0 commit comments

Comments
 (0)