Skip to content

test(design-system): add jsdom consumer test scenarios [AR-117427] - #927

Open
mmurawski-dn wants to merge 7 commits into
drivenets:mainfrom
mmurawski-dn:claude/AR-117427-jsdom-consumer-tests
Open

mmurawski-dn wants to merge 7 commits into
drivenets:mainfrom
mmurawski-dn:claude/AR-117427-jsdom-consumer-tests

Conversation

@mmurawski-dn

@mmurawski-dn mmurawski-dn commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Consumers test their apps with Vitest or Jest on JSDOM, but the design system only ran in real browsers. A new jsdom test project now mounts the components the way consumers do, and a new Guidelines/Testing docs page documents the test setup they need.

Changes

  • Every component story must render in JSDOM with no console errors or warnings.
  • Consumer-style interaction scenarios cover button, text input, checkbox, toggle, radio group, select, autocomplete, time picker, table, tabs, dropdown menu, modal, drawer, popover and tooltip. Any console error or warning fails them too.
  • The test setup is exactly the setup the docs tell consumers to add: stubs for matchMedia, ResizeObserver, scrollTo and scrollIntoView.
  • The scenarios run on the latest jsdom and on jsdom 26 (what Jest 30 ships; a jsdom-26 project that redirects Vitest's jsdom import with a Node resolve hook). Both run with pnpm test, so the regular CI Test job catches JSDOM breakage before release.
  • New Guidelines/Testing Storybook page: the required stubs and what breaks without them, notes for older JSDOM versions in Jest (CSS.escape, highlighted option names), CSS imports in Jest, and known limitations. Being a Guidelines/* page, it is in the docs manifest, so agents using the drivenets-ds MCP read it before writing code. The package README links to it.

Notes for reviewers

  • No component changes. JSDOM gaps are handled in the test setup, not in components.
  • The sweep allows two existing bugs that also appear in a real browser: DsCommentCard nests its action buttons inside a <button>, and DsCodeInput with defaultExpanded logs a zag "node is null" warning. Both need their own tickets.
  • DsTimePicker doesn't call onChange when uncontrolled, in browsers too, so its scenario checks the input value instead.
  • The jsdom project uses the React Compiler plugin, like the build.

@netlify

netlify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

👷 Deploy request for drivenets-design-system pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0189546

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling dependencies design-system labels Nov 24, 2026
Comment thread packages/design-system/package.json Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants