@@ -67,6 +67,35 @@ const testTokenComponent = (Component: React.ComponentType<React.PropsWithChildr
67
67
68
68
expect ( domNode . parentElement ) . toHaveClass ( 'testing-class' )
69
69
} )
70
+
71
+ it ( 'renders with correct data-cursor-is-interactive attribute for button element' , ( ) => {
72
+ const { getByText} = HTMLRender ( < Component as = "button" text = "token" /> )
73
+ const domNode = getByText ( 'token' )
74
+
75
+ expect ( domNode . parentElement ) . toHaveAttribute ( 'data-cursor-is-interactive' , 'true' )
76
+ } )
77
+
78
+ it ( 'renders with correct data-cursor-is-interactive attribute for anchor element' , ( ) => {
79
+ const { getByText} = HTMLRender ( < Component as = "a" text = "token" /> )
80
+ const domNode = getByText ( 'token' )
81
+
82
+ expect ( domNode . parentElement ) . toHaveAttribute ( 'data-cursor-is-interactive' , 'true' )
83
+ } )
84
+
85
+ it ( 'renders with correct data-cursor-is-interactive attribute for span with onClick' , ( ) => {
86
+ const onClick = vi . fn ( )
87
+ const { getByText} = HTMLRender ( < Component text = "token" onClick = { onClick } /> )
88
+ const domNode = getByText ( 'token' )
89
+
90
+ expect ( domNode . parentElement ) . toHaveAttribute ( 'data-cursor-is-interactive' , 'true' )
91
+ } )
92
+
93
+ it ( 'renders with correct data-cursor-is-interactive attribute for non-interactive span' , ( ) => {
94
+ const { getByText} = HTMLRender ( < Component text = "token" /> )
95
+ const domNode = getByText ( 'token' )
96
+
97
+ expect ( domNode . parentElement ) . toHaveAttribute ( 'data-cursor-is-interactive' , 'false' )
98
+ } )
70
99
}
71
100
72
101
describe ( 'Token components' , ( ) => {
0 commit comments