Skip to content

Commit aed9d32

Browse files
test: fix delay show test
1 parent 2afd043 commit aed9d32

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/tooltip-props.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('tooltip props', () => {
9999
expect(container).toMatchSnapshot()
100100
})
101101

102-
test('tooltip with delay show', async () => {
102+
test.only('tooltip with delay show', async () => {
103103
const { container } = render(
104104
<TooltipProps id="example-delay-show" content="Hello World!" delayShow={300} />,
105105
)
@@ -111,10 +111,10 @@ describe('tooltip props', () => {
111111
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument()
112112
})
113113

114-
const tooltip = await screen.findByRole('tooltip')
115-
expect(tooltip).toHaveAttribute('style')
114+
await waitFor(() => {
115+
expect(screen.queryByRole('tooltip')).toHaveClass('react-tooltip__show')
116+
})
116117

117-
expect(tooltip).toBeInTheDocument()
118118
expect(container).toMatchSnapshot()
119119
})
120120

0 commit comments

Comments
 (0)