Skip to content

Bump @vscode-elements/react-elements and fix resulting test failures - #4484

Merged
nickrolfe merged 5 commits into
mainfrom
nickrolfe/fix-vscode-elements-2.4-view-tests
Jul 29, 2026
Merged

Bump @vscode-elements/react-elements and fix resulting test failures#4484
nickrolfe merged 5 commits into
mainfrom
nickrolfe/fix-vscode-elements-2.4-view-tests

Conversation

@nickrolfe

@nickrolfe nickrolfe commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This contains the dependabot bump from #4420 plus some test fixes generated by Copilot.

I asked it to check whether anything in the implementation needed to change as well, and it claims not:

Confirmed — nothing in the implementation code needed changes. Evidence:

  1. Both test failures were test-environment-only issues, not runtime bugs:

• ResizeObserver — jsdom doesn't implement it, but the real VS Code webview (a browser) provides it natively. The 2.x components (vscode-table, etc.) work fine at runtime; only the test env needed the polyfill.
• Checkbox role — 2.x removed the role="checkbox"attribute that 1.x reflected onto the host element, but theinside its shadow DOM still carries the implicitcheckbox` role, so accessibility is preserved. Only the test's DOM query needed updating.

  1. No implementation code uses any removed/rewritten 2.0 API:

• The 2.0 breaking changes were: Tree rewrite, minimized :host styles, removed deprecated APIs, and Tabs accessibility. Grepping non-test code found no usage of VscodeTree, VscodeScrollable (deprecated title), or VscodeContextMenu, and no reliance on the host role.
• The components actually used (VscodeButton, VscodeTextfield, VscodeCheckbox, VscodeDivider, VscodeProgressRing, VscodeBadge, VscodeSingleSelect/VscodeOption, VscodeTabs/VscodeTabHeader/VscodeTabPanel) keep the same props.

  1. npx tsc --noEmit on src/view passes cleanly against the new 2.x typings — no prop/type changes broke any implementation file.

So the version bump is safe; only the two test-only adjustments were required.

dependabot Bot and others added 3 commits July 20, 2026 06:09
Bumps [@vscode-elements/react-elements](https://github.com/vscode-elements/react-elements) from 0.9.0 to 2.4.0.
- [Release notes](https://github.com/vscode-elements/react-elements/releases)
- [Commits](vscode-elements/react-elements@v0.9.0...v2.4.0)

---
updated-dependencies:
- dependency-name: "@vscode-elements/react-elements"
  dependency-version: 2.4.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@vscode-elements/elements 2.x uses ResizeObserver in several components
(e.g. vscode-table, vscode-form-container), which is not implemented in
jsdom. Polyfill it in the view jest setup so these components render in
tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f20698a7-f008-46a3-92a4-63037eb03a05
The vscode-checkbox host element no longer exposes a "checkbox" ARIA role
in @vscode-elements/elements 2.x (the role now lives on an <input> inside
its shadow DOM, which testing-library cannot reach). Find the checkbox by
tag name instead, waiting for the disabled attribute that Lit reflects
asynchronously.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f20698a7-f008-46a3-92a4-63037eb03a05
@nickrolfe nickrolfe changed the title @vscode-elements/react-elements and fix resulting test failures Bump @vscode-elements/react-elements and fix resulting test failures Jul 29, 2026
@nickrolfe
nickrolfe changed the base branch from dependabot/npm_and_yarn/extensions/ql-vscode/vscode-elements/react-elements-2.4.0 to main July 29, 2026 10:03
@nickrolfe
nickrolfe marked this pull request as ready for review July 29, 2026 10:31
@nickrolfe
nickrolfe requested a review from a team as a code owner July 29, 2026 10:31
Copilot AI review requested due to automatic review settings July 29, 2026 10:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates VS Code webview components to v2 and adapts tests to API/environment changes.

Changes:

  • Bumps @vscode-elements/react-elements to 2.4.0.
  • Adds a jsdom ResizeObserver mock.
  • Updates checkbox state tests for the new shadow DOM structure.
Show a summary per file
File Description
extensions/ql-vscode/package.json Updates the dependency version.
extensions/ql-vscode/package-lock.json Locks updated transitive dependencies.
extensions/ql-vscode/src/view/jest.setup.ts Adds the ResizeObserver test mock.
extensions/ql-vscode/src/view/variant-analysis/__tests__/RepoRow.spec.tsx Updates checkbox test queries.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Files not reviewed (1)
  • extensions/ql-vscode/package-lock.json: Generated file
  • Files reviewed: 3/4 changed files
  • Comments generated: 1
  • Review effort level: Medium

The findCheckbox helper only waited for the vscode-checkbox element to
exist, not for Lit to reflect the disabled property to an attribute, so
the enabled/disabled assertions at each call site raced the async
update. Move the assertion into the waitFor callback via an expected
state argument so the retry loop waits for reflection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0f8ebf0f-6429-4147-b7eb-ffacf1a942da
Copilot AI review requested due to automatic review settings July 29, 2026 10:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Files not reviewed (1)
  • extensions/ql-vscode/package-lock.json: Generated file
  • Files reviewed: 3/4 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

@josefs josefs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks plausible to me

@nickrolfe
nickrolfe merged commit 762440b into main Jul 29, 2026
20 checks passed
@nickrolfe
nickrolfe deleted the nickrolfe/fix-vscode-elements-2.4-view-tests branch July 29, 2026 11:09
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.

3 participants