Skip to content

Commit cd46b7f

Browse files
fix(Tooltip.stories): fix open popover snapshot
1 parent aec91a0 commit cd46b7f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/Tooltip/Tooltip.stories.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react"
22
import { RiInformationLine } from "react-icons/ri"
33
import { Box } from "@chakra-ui/react"
44
import { Meta, StoryObj } from "@storybook/react"
5-
import { expect, fireEvent, waitFor, within } from "@storybook/test"
5+
import { expect, fireEvent, userEvent, waitFor, within } from "@storybook/test"
66

77
import InlineLink from "../Link"
88
import Translation from "../Translation"
@@ -47,6 +47,13 @@ const meta = {
4747
},
4848
},
4949
},
50+
decorators: [
51+
(Story) => (
52+
<Box position="relative">
53+
<Story />
54+
</Box>
55+
),
56+
],
5057
} satisfies Meta<TooltipType>
5158

5259
export default meta
@@ -64,9 +71,8 @@ export const OnOpen: Story = {
6471

6572
const tooltipIcon = canvas.getByTestId("tooltip-icon")
6673

67-
fireEvent.mouseOver(tooltipIcon)
68-
6974
await waitFor(async () => {
75+
await userEvent.hover(tooltipIcon)
7076
await expect(canvasParent.getByTestId("tooltip-popover")).toBeVisible()
7177
})
7278
},

0 commit comments

Comments
 (0)