diff --git a/.storybook/pages/WireframeDemo/WireframeDemo.stories.ts b/.storybook/pages/WireframeDemo/WireframeDemo.stories.ts index 0fffed378..b5532065a 100644 --- a/.storybook/pages/WireframeDemo/WireframeDemo.stories.ts +++ b/.storybook/pages/WireframeDemo/WireframeDemo.stories.ts @@ -20,6 +20,6 @@ export const WatchPage: StoryObj = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); const nextPageButton = await canvas.findByText('Hogwarts'); - userEvent.click(nextPageButton); + await userEvent.click(nextPageButton); }, }; diff --git a/package.json b/package.json index 4e0b8cf47..fba631b55 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "eslint-plugin-jest": "^27.6.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-storybook": "^0.6.13", - "eslint-plugin-testing-library": "^5.11.1", + "eslint-plugin-testing-library": "^6.1.2", "husky": "^8.0.3", "identity-obj-proxy": "^3.0.0", "jest": "^29.7.0", diff --git a/src/components/Breadcrumbs/Breadcrumbs.stories.tsx b/src/components/Breadcrumbs/Breadcrumbs.stories.tsx index 3ee0edeee..5123a9805 100644 --- a/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +++ b/src/components/Breadcrumbs/Breadcrumbs.stories.tsx @@ -134,6 +134,6 @@ export const LongTextMenu: StoryObj = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); const dropdownMenuTrigger = await canvas.findByRole('button'); - userEvent.click(dropdownMenuTrigger); + await userEvent.click(dropdownMenuTrigger); }, }; diff --git a/src/components/Card/Card.stories.tsx b/src/components/Card/Card.stories.tsx index 5e2206157..6eed61150 100644 --- a/src/components/Card/Card.stories.tsx +++ b/src/components/Card/Card.stories.tsx @@ -191,6 +191,6 @@ export const InteractiveOnHover: StoryObj = { const canvas = within(canvasElement); const cardContents = await canvas.findByText('Card Contents'); - userEvent.hover(cardContents); + await userEvent.hover(cardContents); }, }; diff --git a/src/components/FiltersDrawer/FiltersDrawer.stories.tsx b/src/components/FiltersDrawer/FiltersDrawer.stories.tsx index b98cbb922..91633d565 100644 --- a/src/components/FiltersDrawer/FiltersDrawer.stories.tsx +++ b/src/components/FiltersDrawer/FiltersDrawer.stories.tsx @@ -48,7 +48,7 @@ export const Default: StoryObj = { if (isChromatic()) { const canvas = within(canvasElement); const filtersTrigger = await canvas.findByRole('button'); - userEvent.click(filtersTrigger); + await userEvent.click(filtersTrigger); } }, }; @@ -233,7 +233,7 @@ export const OverflowInteractive: StoryObj = { if (isChromatic()) { const canvas = within(canvasElement); const filtersTrigger = await canvas.findByRole('button'); - userEvent.click(filtersTrigger); + await userEvent.click(filtersTrigger); } }, }; diff --git a/src/components/FiltersPopover/FiltersPopover.stories.tsx b/src/components/FiltersPopover/FiltersPopover.stories.tsx index 3fee02dfc..c996ba854 100644 --- a/src/components/FiltersPopover/FiltersPopover.stories.tsx +++ b/src/components/FiltersPopover/FiltersPopover.stories.tsx @@ -51,7 +51,7 @@ export const Default: StoryObj = { if (isChromatic()) { const canvas = within(canvasElement); const filtersTrigger = await canvas.findByRole('button'); - userEvent.click(filtersTrigger); + await userEvent.click(filtersTrigger); } }, }; @@ -246,7 +246,7 @@ export const OverflowInteractive: StoryObj = { if (isChromatic()) { const canvas = within(canvasElement); const filtersTrigger = await canvas.findByRole('button'); - userEvent.click(filtersTrigger); + await userEvent.click(filtersTrigger); } }, }; diff --git a/src/components/Menu/Menu.stories.tsx b/src/components/Menu/Menu.stories.tsx index 4a7764582..188c6d025 100644 --- a/src/components/Menu/Menu.stories.tsx +++ b/src/components/Menu/Menu.stories.tsx @@ -207,9 +207,9 @@ export const Opened: StoryObj = { // Sets the delay (in milliseconds) for a specific story. chromatic: { delay: 300 }, }, - play: () => { - userEvent.tab(); - userEvent.keyboard(' ', { delay: 300 }); + play: async () => { + await userEvent.tab(); + await userEvent.keyboard(' ', { delay: 300 }); }, }; diff --git a/src/components/Popover/Popover.stories.tsx b/src/components/Popover/Popover.stories.tsx index a1e9c8c24..d3580a5e9 100644 --- a/src/components/Popover/Popover.stories.tsx +++ b/src/components/Popover/Popover.stories.tsx @@ -77,7 +77,7 @@ export const Default: Story = { if (isChromatic()) { const canvas = within(canvasElement); const filtersTrigger = await canvas.findByRole('button'); - userEvent.click(filtersTrigger); + await userEvent.click(filtersTrigger); } }, }; diff --git a/src/components/Slider/Slider.stories.tsx b/src/components/Slider/Slider.stories.tsx index e20cd2c58..30950fbd8 100644 --- a/src/components/Slider/Slider.stories.tsx +++ b/src/components/Slider/Slider.stories.tsx @@ -161,7 +161,7 @@ export const Tooltip: Story = { const canvas = within(canvasElement); const slider = await canvas.findByRole('slider'); - userEvent.hover(slider); + await userEvent.hover(slider); } }, }; @@ -177,8 +177,8 @@ export const Focus: Story = { */ snapshot: { skip: true }, }, - play: () => { - userEvent.tab(); + play: async () => { + await userEvent.tab(); }, }; diff --git a/yarn.lock b/yarn.lock index aaf90764e..57896bf28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3057,7 +3057,7 @@ __metadata: eslint-plugin-jest: "npm:^27.6.0" eslint-plugin-prettier: "npm:^5.0.1" eslint-plugin-storybook: "npm:^0.6.13" - eslint-plugin-testing-library: "npm:^5.11.1" + eslint-plugin-testing-library: "npm:^6.1.2" graphemer: "npm:^1.4.0" husky: "npm:^8.0.3" identity-obj-proxy: "npm:^3.0.0" @@ -11676,14 +11676,14 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-testing-library@npm:^5.11.1": - version: 5.11.1 - resolution: "eslint-plugin-testing-library@npm:5.11.1" +"eslint-plugin-testing-library@npm:^6.1.2": + version: 6.1.2 + resolution: "eslint-plugin-testing-library@npm:6.1.2" dependencies: "@typescript-eslint/utils": "npm:^5.58.0" peerDependencies: eslint: ^7.5.0 || ^8.0.0 - checksum: 3b2f010b13fbffd9a2018815cdca7edfce64523d9263ed376b33bdc43fca297100dab755a40f5b8be0f8e76b44bc7883590acfa9016fbff20888d9ee67f964d0 + checksum: 83399dae21422ca7e2ac99ff6666dffa64e31773132cb1854d00b29e8a6f6f167cc8f6f4e73112bef26a631d4c76e4b947aa6f7032d5c9cf1f7548de1f4b32bf languageName: node linkType: hard