You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
My team is trying to replace JSDOM with happy-dom and we are hitting some unexpected differences in behavior with regards to query selector. In particular, we have a minimal repro of a query selector that does not match the output of JSDOM or chromium.
To Reproduce
This unit test in QuerySelector.test.ts captures the issue.
it('Supports grouped selectors',()=>{constdiv=document.createElement('div');div.innerHTML=` <div class> <h1><span>Here is a heading</span></h1> <div class="a"> <span>With a child span</span> </div> </div> `;expect(div.querySelector('.a,h1')).toBe(div.children[0].children[0])})
Expected behavior
The behavior here is that the div with class a is being returned, instead of the h1 which is what is returned in jsdom and in the browser.
Screenshots
If applicable, add screenshots to help explain your problem.
Device:
Node 22 on Windows, MacOS, and Linux
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
My team is trying to replace JSDOM with happy-dom and we are hitting some unexpected differences in behavior with regards to query selector. In particular, we have a minimal repro of a query selector that does not match the output of JSDOM or chromium.
To Reproduce
This unit test in QuerySelector.test.ts captures the issue.
Expected behavior
The behavior here is that the div with class a is being returned, instead of the h1 which is what is returned in jsdom and in the browser.
Screenshots
If applicable, add screenshots to help explain your problem.
Device:
Node 22 on Windows, MacOS, and Linux
Additional context
The text was updated successfully, but these errors were encountered: