File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
import ProductList from '@/pages/product-list'
2
2
import type { Meta , StoryObj } from '@storybook/react'
3
+ import { userEvent , within } from '@storybook/test'
3
4
import { MemoryRouter , Route , Routes } from 'react-router-dom'
4
5
5
6
const meta : Meta < typeof ProductList > = {
@@ -29,4 +30,18 @@ export const Default: Story = {
29
30
</ MemoryRouter >
30
31
)
31
32
} ,
33
+ play : async ( { canvasElement } ) => {
34
+ const canvas = within ( canvasElement )
35
+
36
+ const deleteButton = (
37
+ await canvas . findAllByRole ( 'button' , { name : '削除' } )
38
+ ) [ 0 ]
39
+ await userEvent . click ( deleteButton )
40
+
41
+ const confirmButton = (
42
+ await canvas . findAllByRole ( 'button' , { name : '削除する' } )
43
+ ) [ 0 ]
44
+
45
+ await userEvent . click ( confirmButton )
46
+ } ,
32
47
}
You can’t perform that action at this time.
0 commit comments