-
-
Notifications
You must be signed in to change notification settings - Fork 533
[BUG] Can't pass jest toBeVisible #1058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Try using Check how we get it to work on our own tests. |
I use Test Code: it.only('test', async () => {
const { getByTestId, getByText, getByRole } = render(
<>
<div data-testid="test" data-tooltip-id='test' data-tooltip-content='tooltip!'>test</div>
<ReactTooltip id="test" />
</>
);
expect(getByText('test')).toBeInTheDocument();
await userEvent.hover(getByTestId('test'));
await waitFor(() => {
expect(getByRole('tooltip')).toBeVisible();
})
}); Test Result:
|
Looking at <ReactTooltip id="test" style={{ opacity: 1 }} /> If nothing changes, also try with |
Only with both |
it.only('test', async () => {
const { getByTestId, getByText, getByRole } = render(
<>
<div data-testid="test" data-tooltip-id='test' data-tooltip-content='tooltip!'>test</div>
<ReactTooltip id="test" />
</>
);
expect(getByText('test')).toBeInTheDocument();
await userEvent.hover(getByTestId('test'));
await waitFor(() => {
expect(getByRole('tooltip')).toBeVisible();
})
}); Running your exact test code with Please provide your Aside from that, @danielbarion any ideas on why the test wouldn't pass? |
With those pieces of information, I have no Idea @gabrieljablonski. Maybe after @rayandben2000 gives more information. |
This issue is stale because it has not seen activity in 30 days. Remove the |
I'll close this for now and we'll track issues with the test suites from #1080. |
Bug description
Even simple code can't pass jest toBeVisible (see To Reproduce section.)
Version of Package
v5.16.1
To Reproduce
Test Code:
Test Result:
Expected behavior
Should pass
toBeVisible
Addition information
The text was updated successfully, but these errors were encountered: