Skip to content

Fix/jsdom 31 isvisible - #3009

Closed
SuperDJ wants to merge 5 commits into
vuejs:mainfrom
SuperDJ:fix/jsdom-31-isvisible
Closed

SuperDJ wants to merge 5 commits into
vuejs:mainfrom
SuperDJ:fix/jsdom-31-isvisible

Conversation

@SuperDJ

@SuperDJ SuperDJ commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #3008.

Would possibly fix #3006 as well.

jsdom 31 follows the CSS spec and returns empty computed styles for elements that are not connected to a document. Components mounted without attachTo render into a detached container, so isVisible() returned true for elements hidden via v-show or an inline style.

Fall back to the inline style when a computed value is empty. Behaviour on environments that still compute styles for detached elements (jsdom 30, happy-dom) is unchanged. Stylesheet rules can only apply to connected elements, so the stylesheet test now mounts with attachTo.

Also bump jsdom to 31.0.0.

SuperDJ and others added 5 commits November 10, 2026 10:46
- vue, @vue/* 3.5.45, vitest and @vitest/coverage-v8 5.1.0
- oxfmt 0.77.0, oxlint 1.92.0, vite 8.3.6 (newer releases still within
  pnpm's minimumReleaseAge window)
- vue-component-type-helpers ^3.3.14, js-beautify ^2.0.3
- refresh lockfile within existing ranges, fixing advisories in
  picomatch, @babel/core and browserslist

jsdom stays on 30.x: jsdom 31 returns empty computed styles for
disconnected elements, which breaks isVisible() for detached mounts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- remove jsdom-global (unused)
- replace husky with simple-git-hooks: the husky v4-style config was
  ignored by husky 9 and no .husky directory existed, so the pre-commit
  hook never ran. Hooks are installed by the prepare script; the
  simple-git-hooks postinstall script stays blocked via allowBuilds.
- replace lint-staged with nano-staged (0 dependencies), same config

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- remove jsdom-global (unused)
- replace husky with simple-git-hooks: the husky v4-style config was
  ignored by husky 9 and no .husky directory existed, so the pre-commit
  hook never ran. Hooks are installed by the prepare script; the
  simple-git-hooks postinstall script stays blocked via allowBuilds.
- replace lint-staged with nano-staged (0 dependencies), same config

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Superseded by the rebase onto chore/deps-refresh (vuejs#3007); tree unchanged.
jsdom 31 follows the CSS spec and returns empty computed styles for
elements that are not connected to a document. Components mounted
without `attachTo` render into a detached container, so isVisible()
returned true for elements hidden via v-show or an inline style.

Fall back to the inline style when a computed value is empty. Behaviour
on environments that still compute styles for detached elements (jsdom
30, happy-dom) is unchanged. Stylesheet rules can only apply to
connected elements, so the stylesheet test now mounts with `attachTo`.

Also bump jsdom to 31.0.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@netlify

netlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vue-test-utils-docs ready!

Name Link
🔨 Latest commit 89950e7
🔍 Latest deploy log https://app.netlify.com/projects/vue-test-utils-docs/deploys/6af2ef691fe71421505148aa
😎 Deploy Preview https://deploy-preview-3009--vue-test-utils-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SuperDJ SuperDJ mentioned this pull request Nov 10, 2026
@cexbrayat

Copy link
Copy Markdown
Member

Thanks for investigating. We’ll fix the tests to use attachTo: document.body, as already required by the docs, rather than add a partial fallback for detached elements.

Closing in favor of #3015

@cexbrayat cexbrayat closed this Nov 13, 2026
@SuperDJ
SuperDJ deleted the fix/jsdom-31-isvisible branch November 16, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants