Skip to content
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

Tooltip tests occasionally fail #988

Open
bartaz opened this issue Oct 18, 2023 · 0 comments
Open

Tooltip tests occasionally fail #988

bartaz opened this issue Oct 18, 2023 · 0 comments

Comments

@bartaz
Copy link
Contributor

bartaz commented Oct 18, 2023

Tooltips tests fail from time to time. It's hard to reproduce as it doesn't happen in deterministic way.

The error when it happens is:

  ● Tooltip › updates the tooltip to fit on the screen

    expect(element).toHaveClass("p-tooltip--btm-left")

    Expected the element to have class:
      p-tooltip--btm-left
    Received:
      p-tooltip--right is-detached

      153 |     await userEvent.hover(screen.getByRole("button", { name: "Child" }));
      154 |
    > 155 |     expect(screen.getByTestId("tooltip-portal")).toHaveClass(
          |                                                  ^
      156 |       "p-tooltip--btm-left"
      157 |     );
      158 |     expect(screen.getByTestId("tooltip-portal")).toHaveClass("is-detached");

      at src/components/Tooltip/Tooltip.test.tsx:155:50
      at fulfilled (src/components/Tooltip/Tooltip.test.tsx:28:58)

There seems to be some bug or race condition either in the Tooltip component or its test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant