File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export const ClickAnimation = ({
49
49
bottom = { bottom }
50
50
insetInline = { 0 }
51
51
color = "primary.base"
52
+ data-testid = "click-animation-el"
52
53
>
53
54
< MotionFlex
54
55
direction = { direction }
Original file line number Diff line number Diff line change
1
+ import type { Meta , StoryObj } from "@storybook/react/*"
2
+ import { expect , waitFor , within } from "@storybook/test"
3
+
4
+ import { Button } from "@/components/ui/buttons/Button"
5
+
6
+ import { ClickAnimation } from "../ClickAnimation"
7
+
8
+ const meta = {
9
+ title : "Molecules / Display Content / Simulator / ClickAnimation" ,
10
+ component : ClickAnimation ,
11
+ decorators : [
12
+ ( Story ) => (
13
+ < div className = "relative" >
14
+ < Story />
15
+ < Button > Visit NFT Market</ Button >
16
+ </ div >
17
+ ) ,
18
+ ] ,
19
+ args : {
20
+ children : "Click!" ,
21
+ } ,
22
+ play : async ( { canvasElement } ) => {
23
+ const canvas = within ( canvasElement )
24
+
25
+ await waitFor (
26
+ async ( ) => {
27
+ const animationEl = canvas . getByTestId ( "click-animation-el" )
28
+
29
+ await expect ( animationEl ) . toBeVisible ( )
30
+ await waitFor (
31
+ async ( ) => {
32
+ await expect ( animationEl ) . toHaveStyle ( { transform : "none" } )
33
+ } ,
34
+ { timeout : 1500 }
35
+ )
36
+ } ,
37
+ { timeout : 6000 }
38
+ )
39
+ } ,
40
+ } satisfies Meta < typeof ClickAnimation >
41
+
42
+ export default meta
43
+
44
+ type Story = StoryObj < typeof meta >
45
+
46
+ export const Default : Story = { }
47
+
48
+ export const Below : Story = {
49
+ args : {
50
+ below : true ,
51
+ } ,
52
+ }
You can’t perform that action at this time.
0 commit comments