1
1
/* eslint-disable @typescript-eslint/explicit-function-return-type */
2
+ import { expect } from '@storybook/jest' ;
3
+ import { userEvent , waitFor , within } from '@storybook/testing-library' ;
2
4
import { StoryObj } from '@storybook/vue3' ;
3
5
import { galleryPost } from '../../.storybook/fakes' ;
4
6
import MkGalleryPostPreview from './MkGalleryPostPreview.vue' ;
5
- import { userEvent , within } from '@storybook/testing-library' ;
6
- import { expect } from '@storybook/jest' ;
7
7
export const Default = {
8
8
render ( args ) {
9
9
return {
@@ -50,7 +50,7 @@ export const Hover = {
50
50
await Default . play ( context ) ;
51
51
const canvas = within ( context . canvasElement ) ;
52
52
const links = canvas . getAllByRole ( 'link' ) ;
53
- await userEvent . hover ( links [ 0 ] ) ;
53
+ await waitFor ( ( ) => userEvent . hover ( links [ 0 ] ) ) ;
54
54
} ,
55
55
} satisfies StoryObj < typeof MkGalleryPostPreview > ;
56
56
export const HoverThenUnhover = {
@@ -59,7 +59,7 @@ export const HoverThenUnhover = {
59
59
await Hover . play ( context ) ;
60
60
const canvas = within ( context . canvasElement ) ;
61
61
const links = canvas . getAllByRole ( 'link' ) ;
62
- await userEvent . unhover ( links [ 0 ] ) ;
62
+ await waitFor ( ( ) => userEvent . unhover ( links [ 0 ] ) ) ;
63
63
} ,
64
64
} satisfies StoryObj < typeof MkGalleryPostPreview > ;
65
65
export const Sensitive = {
0 commit comments