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
Basically, the JSDOM output has checked="" but the Happy DOM doesn't.
I have tested that the checkbox is actually checked.
Expected behavior
Serialized output for checkboxes includes checked="" when the checkbox is checked.
Screenshots
This is the Happy DOM result
And this is the JSDOM result
Device:
OS: MacOS 15.1
Browser: Vitest
Version: 2.1.4
Happy DOM version: 15.10.1
JSDOM version: 25.0.1
Additional context
I've been debugging the serialization step in our app, and I can see that the checkbox does not have the checked property in the namedItems map. This in XMLSerializer.js
This is the real test; Not much different from the repo I provided.
I haven't been able to find the place where these properties are being added.
Thanks for the help. If there is anything I can help with, let me know :)
The text was updated successfully, but these errors were encountered:
Describe the bug
I want to bring up #1023 again, as the original behaviour described was not the one implemented in the fix.
When a Input element with type Checkbox is serialized in React tests, the
checked=""
is not being added.To Reproduce
I've created this repo that showcases the issue: https://github.com/Tsubasa1218/happy-dom-checkbox.
The app only renders an
Input[type="checkbox"]
withchecked={true}
. I then create a snapshot test for both Happy DOM and JSDOM. You can check the snapshots here: https://github.com/Tsubasa1218/happy-dom-checkbox/tree/main/src/__snapshots__Basically, the JSDOM output has
checked=""
but the Happy DOM doesn't.I have tested that the checkbox is actually checked.
Expected behavior
Serialized output for checkboxes includes
checked=""
when the checkbox is checked.Screenshots
This is the Happy DOM result
And this is the JSDOM result
Device:
Additional context
I've been debugging the serialization step in our app, and I can see that the checkbox does not have the
checked
property in thenamedItems
map. This in XMLSerializer.jsThis is the real test; Not much different from the repo I provided.
I haven't been able to find the place where these properties are being added.
Thanks for the help. If there is anything I can help with, let me know :)
The text was updated successfully, but these errors were encountered: