Skip to content

test: expand coverage for interactive primitives and SSR safety#82

Draft
developit wants to merge 1 commit intomainfrom
codex/expand-tests-for-interactive-primitives
Draft

test: expand coverage for interactive primitives and SSR safety#82
developit wants to merge 1 commit intomainfrom
codex/expand-tests-for-interactive-primitives

Conversation

@developit
Copy link
Copy Markdown
Owner

Motivation

  • Add focused interaction tests for primitives that wrap native dialog/menu behaviors to catch regressions in keyboard and overlay handling.
  • Ensure components that install global handlers or reference document render safely under SSR without a DOM.
  • Verify factory/wrapper attribute forwarding (p, command, commandfor) to prevent accidental regressions in markup output.
  • Gate releases on the test suite so builds/deploys run tests first in CI.

Description

  • Added three new test files: src/__tests__/interactive-primitives.test.tsx, src/__tests__/ssr-no-dom.test.tsx, and src/__tests__/attributes-render.test.tsx with interaction, SSR, and attribute assertions respectively.
  • Tests cover keyboard behavior (Enter, Escape, ArrowUp, ArrowDown), overlay close regressions (backdrop/outside clicks), focus restoration, Sheet/Drawer command wiring, Tabs/Toast usage, and rendered attribute assertions.
  • Included a small HTMLDialogElement polyfill in the jsdom tests to emulate show/showModal/close + Escape handling for reliable behavior assertions.
  • Updated CI workflows (.github/workflows/size.yml, .github/workflows/deploy.yml) to run pnpm test before build/deploy and added jsdom as a dev dependency (updated package.json and pnpm-lock.yaml).

Testing

  • Ran the test suite with pnpm test (Vitest) and all tests passed: 4 test files, 8 tests total, all green.
  • Verified the new interaction tests exercise Dialog, Popover, DropdownMenu, Sheet, Drawer, Tabs, and Toast behaviors under jsdom.
  • Ran pnpm lint (TS + biome) which reported TypeScript typing errors unrelated to the new tests (notably command/commandFor typing mismatches and a selected prop typing in a test), so linting currently fails and should be addressed separately.

Codex Task

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 23, 2026

Deploy Preview for pui-demo ready!

Name Link
🔨 Latest commit 09730a4
🔍 Latest deploy log https://app.netlify.com/projects/pui-demo/deploys/699c590bc743e80008409e22
😎 Deploy Preview https://deploy-preview-82--pui-demo.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.

@github-actions
Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 13.7 kB

ℹ️ View Unchanged
Filename Size
dist/index.css 8.31 kB
dist/index.js 5.38 kB

compressed-size-action

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.

1 participant