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
test('returns null if no active tab are present',()=>{document.body.innerHTML='<div class="container">'+'<div class="tab" data-track-id="one"></div>'+'<div class="tab" data-track-id="two"></div>'+'</div>';expect(getActiveTabTrackId()).toBe(null);})
When we run it, test fails because NodeList its returning the first element instead of undefined
Expected behavior document.querySelector(".container").childNodes[[]] should return undefined instead of the first element.
Device:
OS: macos
Browser: happy-dom and jest
Version: 16.6.0
Additional context
We are using Jest and @happy-dom/jest-environment
The text was updated successfully, but these errors were encountered:
Describe the bug
When you use an empty array as an index of a NodeList it returns the first element instead of undefined.
To Reproduce
Steps to reproduce the behavior:
We have the following function:
And we are testing it using:
When we run it, test fails because NodeList its returning the first element instead of undefined
Expected behavior
document.querySelector(".container").childNodes[[]]
should return undefined instead of the first element.Device:
Additional context
We are using Jest and @happy-dom/jest-environment
The text was updated successfully, but these errors were encountered: