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

Tests that set the value of a <meter> fail after upgrading to v15 #1601

Closed
petegraves opened this issue Nov 11, 2024 · 2 comments · Fixed by #1607
Closed

Tests that set the value of a <meter> fail after upgrading to v15 #1601

petegraves opened this issue Nov 11, 2024 · 2 comments · Fixed by #1607
Assignees
Labels
bug Something isn't working

Comments

@petegraves
Copy link

Describe the bug
After upgrading to happy-dom 15, tests for a Vue component that set the value or max of a <meter> element have started failing.

To Reproduce

  1. Go to this StackBlitz example
  2. Upgrade happy-dom to ^15
  3. See error:

stderr | test/basic.test.ts > mount component
[Vue warn]: Failed setting prop "max" on : value 10 is invalid. TypeError: Failed to set the 'max' property on 'HTMLMeterElement': The provided double value is non-finite.
at set.max (file:///home/projects/vitest-dev-vitest-uu9zyg/node_modules/happy-dom/lib/nodes/html-meter-element/HTMLMeterElement.js:101:19)
at patchDOMProp (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js:597:13)
at patchProp (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js:708:5)
at mountElement (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:4790:11)
at processElement (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:4737:7)
at patch (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:4605:11)
at ReactiveEffect.componentUpdateFn (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5232:11)
at ReactiveEffect.run (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/reactivity/dist/reactivity.cjs.js:226:19)
at setupRenderEffect (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5360:5)
at mountComponent (/home/projects/vitest-dev-vitest-uu9zyg/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5135:7)

Expected behavior
Component mounts and HTML matches snapshot.

Additional context
In HTMLMeterElement.ts there is typeof value !== 'number' added in #1332, but in patchDOMProp from @vue/runtime-dom/dist/runtime-dom.cjs.js the values are converted to Strings.

This error doesn't happen in happy-dom 14 or jsdom.

@petegraves petegraves added the bug Something isn't working label Nov 11, 2024
@capricorn86 capricorn86 self-assigned this Nov 13, 2024
capricorn86 added a commit that referenced this issue Nov 13, 2024
capricorn86 added a commit that referenced this issue Nov 13, 2024
@capricorn86
Copy link
Owner

Thank you for reporting @petegraves! 🙂

I believe that it should be fixed now.

@petegraves
Copy link
Author

Thanks @capricorn86!

Yes this is working now in 15.11.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants