Hey! I had a similar issue with Headless UI jsdom a while back. Turns out, jsdom doesn’t fully replicate browser behavior, especially for complex interactions.
What worked for me was using `@testing-library/react` alongside jsdom. It handles a lot of the quirks for you. Also, make sure you’re using the latest version of jsdom—some older versions have weird bugs.
For mocking the DOM, I’d recommend checking out the docs for `jest-environment-jsdom`. It’s got some solid examples.
Good luck!
What worked for me was using `@testing-library/react` alongside jsdom. It handles a lot of the quirks for you. Also, make sure you’re using the latest version of jsdom—some older versions have weird bugs.
For mocking the DOM, I’d recommend checking out the docs for `jest-environment-jsdom`. It’s got some solid examples.
Good luck!
