File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
site/src/pages/TemplatePage/TemplateInsightsPage Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
import type { Meta , StoryObj } from "@storybook/react-vite" ;
2
+ import { within } from "@testing-library/react" ;
2
3
import type { ComponentProps } from "react" ;
4
+ import { userEvent } from "storybook/test" ;
3
5
import { TemplateInsightsControls } from "./TemplateInsightsPage" ;
4
6
5
7
const meta : Meta < typeof TemplateInsightsControls > = {
@@ -25,11 +27,21 @@ export const Day: Story = {
25
27
...defaultArgs ,
26
28
interval : "day" ,
27
29
} ,
30
+ play : async ( { canvasElement } ) => {
31
+ const canvas = within ( canvasElement ) ;
32
+ const datePicker = canvas . getAllByRole ( "button" ) [ 1 ] ;
33
+ await userEvent . click ( datePicker ) ;
34
+ } ,
28
35
} ;
29
36
30
37
export const Week : Story = {
31
38
args : {
32
39
...defaultArgs ,
33
40
interval : "week" ,
34
41
} ,
42
+ play : async ( { canvasElement } ) => {
43
+ const canvas = within ( canvasElement ) ;
44
+ const dropdown = canvas . getAllByRole ( "button" ) [ 1 ] ;
45
+ await userEvent . click ( dropdown ) ;
46
+ } ,
35
47
} ;
You can’t perform that action at this time.
0 commit comments