Skip to content

Commit 921425d

Browse files
Fix Action Icon tooltip story
1 parent 6a7882d commit 921425d

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

packages/lib/src/action-icon/ActionIcon.stories.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Meta, StoryObj } from "@storybook/react-vite";
2+
import { userEvent, within } from "storybook/internal/test";
23
import DxcActionIcon from "./ActionIcon";
34
import DxcFlex from "../flex/Flex";
45
import 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+
216226
export 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
};

0 commit comments

Comments
 (0)