Skip to content

chore: bump the vitest group with 4 updates [AR-89256] - #700

Open
mmurawski-dn wants to merge 3 commits into
mainfrom
drivenets/keen-cray-aj8qmd
Open

chore: bump the vitest group with 4 updates [AR-89256]#700
mmurawski-dn wants to merge 3 commits into
mainfrom
drivenets/keen-cray-aj8qmd

Conversation

@mmurawski-dn

Copy link
Copy Markdown
Collaborator

Summary

Supersedes #694, whose CI failed after the vitest 5 upgrade (vitest, @vitest/coverage-v8, @vitest/browser-playwright → v5.0.0, vitest-browser-react → v2.3.0):

  • Type Check failure: ds-split-button test passed a RegExp to toHaveTextContent, which is now typed string | number-only in vitest 5's browser matchers.
  • Test failures: vitest 5 split the browser-mode toHaveTextContent jest-dom matcher into an exact-match-only assertion plus a new toMatchTextContent for partial/RegExp matching (see the vitest browser assertions docs). Every test that relied on the old partial-match default (checking a select trigger's text alongside its icon, a table row's text alongside other cells, a tooltip listing several names, etc.) needed to switch to toMatchTextContent.
  • Similarly, getByRole/getByText locators now need exact: false passed explicitly to get substring name matching that used to be the default (affects ds-toggle, ds-table-header-ellipsis, ds-time-picker).
  • One more failure was a real interaction-order issue: ds-table-editable hovered a reveal-on-hover lock icon (pointer-events: none until the parent cell is hovered) directly, which the upgraded Playwright's stricter actionability check now rejects. Hovering the parent cell first (mirroring how a real pointer reaches the icon) fixes it.
  • Two more instances of the same toHaveTextContent/RegExp issue (ds-avatar-group, ds-comments-drawer) were introduced by commits that landed on main after chore: bump the vitest group with 4 updates #694 was opened; fixed here too since this PR is rebased on current main.

Added a patch changeset for @drivenets/design-system, matching this repo's convention for dependency-bump PRs (see .github/scripts/generate-dependabot-changeset.ts).

Test plan

  • tsc (full package, not just affected) — 0 errors
  • All 12 previously-failing test files now pass in isolation and together
  • Lockfile updated via a scoped pnpm update (matches dependabot's own diff shape — only vitest and its direct transitive deps changed, no incidental churn)

https://claude.ai/code/session_01FruzGJAvphgB11ptUBPrBt


Generated by Claude Code

@netlify

netlify Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploy Preview for drivenets-design-system ready!

Name Link
🔨 Latest commit fa0dc2a
🔍 Latest deploy log https://app.netlify.com/projects/drivenets-design-system/deploys/6aa0052bc6fca40008fce130
😎 Deploy Preview https://deploy-preview-700--drivenets-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Copy link
Copy Markdown
Collaborator Author

Check Unused Code and Dependencies failed with pnpm dedupe --check finding duplicate transitive resolutions (@babel/types, picomatch, flatted, ws, etc.) left over after the scoped vitest bump. Pushed a pnpm dedupe commit to clean those up — this mirrors the dedupe step dependabot's own automation runs after a bump (.github/workflows/dependabot-side-effects.yml). Re-verified tsc and the full set of previously-fixed browser tests still pass on the deduped lockfile.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Pushed a second round of fixes for Test failures on the previous commit — same root cause as before (vitest 5's stricter exact-match defaults for getByRole/getByText), just in more components than the original PR's CI run exercised: DsMainMenu, DsTopBarNavigation, DsDropdownMenu, DsFileUpload, DsKeyValuePair, DsBreadcrumb — all render an icon glyph as literal text right next to a label, so exact: false is needed to match. Also fixed DsPanel's width tests (same getByText issue) and one DsMainMenu tooltip-hover test needing { force: true } for a stricter Playwright actionability check.

One failure I'm leaving as-is: ds-comment-bubble.browser.test.tsx > should call onClose when close button is clicked in thread. I reproduced it locally against both vitest 5 (this PR) and vitest 4.1.10 (current main, unmodified) — it fails identically both ways, so it predates this PR and isn't caused by the dependency bump. I wasn't able to root-cause it (tried userEvent.click and waiting on document.fonts.ready, neither changed the outcome) and didn't want to guess at a product-level fix blind. This will likely still show red on this PR's Test job since it's a single aggregated command — flagging it explicitly here rather than leaving it unexplained. Happy to file this as its own issue if useful.

Re-verified tsc (0 errors) and all touched test files green (94/94) before pushing.


Generated by Claude Code

Dependabot's original PR (#694) bumped vitest, @vitest/coverage-v8,
@vitest/browser-playwright to v5 and vitest-browser-react to v2.3.0,
but CI failed: vitest 5's browser-mode matchers split `toHaveTextContent`
into an exact-match-only assertion plus a new `toMatchTextContent` for
partial/RegExp matching, and `getByRole`/`getByText` locators now need
`exact: false` explicitly for substring name matching that used to be
the default. This updates the affected browser tests to match.

Also fixes a table test that hovered a reveal-on-hover icon directly
(pointer-events: none until the parent is hovered) — hovering the
parent cell first mirrors how a real pointer reaches the icon.

Claude-Session: https://claude.ai/code/session_01FruzGJAvphgB11ptUBPrBt
pnpm dedupe --check (Check Unused Code and Dependencies job) flagged
several transitive packages left with duplicate resolved versions after
the scoped vitest update. Running pnpm dedupe collapses them, matching
the dedupe step dependabot's own automation runs after a bump
(.github/workflows/dependabot-side-effects.yml).

Claude-Session: https://claude.ai/code/session_01FruzGJAvphgB11ptUBPrBt
Same root cause as the earlier fix: several components render an icon
glyph as literal text (material-symbols-outlined ligature) directly
adjacent to a label within one accessible-name/text run (tile links in
DsMainMenu/DsTopBarNavigation, group labels in DsDropdownMenu, status
messages in DsFileUpload, labels/values in DsKeyValuePair, breadcrumb
segments). Passing `exact: false` restores the substring name/text
matching these tests relied on before the vitest 5 upgrade.

Also fixes:
- DsMainMenu's coming-soon tooltip hover test: the badge sits inside an
  aria-disabled tile: `hover({ force: true })` bypasses the stricter
  actionability check the new Playwright version now enforces there.
- DsPanel's width tests: querying `getByText('Content')` synchronously
  needs exact:false for the same reason as everywhere else above.

One known failure was investigated and left as-is:
`ds-comment-bubble.browser.test.tsx > should call onClose when close
button is clicked in thread` reproduces identically against the
pre-bump vitest 4.1.10 on current main, so it predates this change and
is unrelated to it.

Claude-Session: https://claude.ai/code/session_01FruzGJAvphgB11ptUBPrBt
@mmurawski-dn
mmurawski-dn force-pushed the drivenets/keen-cray-aj8qmd branch from 560ca3e to fa0dc2a Compare September 8, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants