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

Panels messes with click events in react-testing-library tests using JSDOM. #398

Closed
karl-run opened this issue Aug 30, 2024 · 2 comments
Closed

Comments

@karl-run
Copy link

karl-run commented Aug 30, 2024

I just discovered this, so I haven't made a minimal repro yet.

But I had this simple home-made two pane view that I could 1:1 replace with two Panel in a PanelGroup (diff) which was super nice!

But I have a couple of RTL+JSDOM tests that started failing on non-obvious stuff, like clicking a button using userEvent would be fine, it would find the button and click it, and whatever what supposed to happen after the button click didn't happen. Like the event didn't fire at all.

For example this test (big uggo test pls don't judge 😓) would fail on line 53:

https://github.com/navikt/syk-dig/blob/main/src/components/nasjonal-oppgave/__tests__/submitOppgave.test.tsx#L52-L53

If I straight up replace all the Panel and PanelGroup with div the tests run again.

@bvaughn
Copy link
Owner

bvaughn commented Aug 30, 2024

Seems like a duplicate of #367. Check out this comment about styling: #367 (comment)

@bvaughn
Copy link
Owner

bvaughn commented Sep 3, 2024

This seems most likely to be a duplicate so I'm going to close it for now.

@bvaughn bvaughn closed this as completed Sep 3, 2024
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

2 participants