File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
packages/lib/src/action-icon Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 11import { Meta , StoryObj } from "@storybook/react-vite" ;
2+ import { userEvent , within } from "storybook/internal/test" ;
23import DxcActionIcon from "./ActionIcon" ;
34import DxcFlex from "../flex/Flex" ;
45import Title from "../../.storybook/components/Title" ;
@@ -213,13 +214,20 @@ export const Types: Story = {
213214 ) ,
214215} ;
215216
217+ const Tooltip = ( ) => (
218+ < >
219+ < Title title = "Default tooltip" theme = "ligth" level = { 2 } />
220+ < ExampleContainer >
221+ < DxcActionIcon title = "Home" icon = "home" color = "neutral" />
222+ </ ExampleContainer >
223+ </ >
224+ ) ;
225+
216226export const ActionIconTooltip : Story = {
217- render : ( ) => (
218- < >
219- < Title title = "Default tooltip" theme = "ligth" level = { 2 } />
220- < ExampleContainer >
221- < DxcActionIcon title = "Home" icon = "home" color = "neutral" />
222- </ ExampleContainer >
223- </ >
224- ) ,
227+ render : Tooltip ,
228+ play : async ( { canvasElement } ) => {
229+ const canvas = within ( canvasElement ) ;
230+ const button = await canvas . findByRole ( "button" ) ;
231+ await userEvent . hover ( button ) ;
232+ } ,
225233} ;
You can’t perform that action at this time.
0 commit comments