Skip to content

chore: add vitest browser mode for component tests#179

Open
johnleider wants to merge 6 commits intomasterfrom
feat/vitest-browser-mode
Open

chore: add vitest browser mode for component tests#179
johnleider wants to merge 6 commits intomasterfrom
feat/vitest-browser-mode

Conversation

@johnleider
Copy link
Copy Markdown
Member

Summary

  • Add Vitest browser mode (Playwright/chromium) for all 30 component tests
  • Dual-project vitest config: v0:unit (happy-dom) for composable/utility tests, v0:browser (Playwright) for component tests
  • Component test files renamed from *.test.ts to *.browser.test.ts to distinguish test types
  • Remove happy-dom workarounds (showPopover/hidePopover mocks) from Select, Combobox, and Dialog — real browser has native APIs
  • Test infrastructure in packages/0/test/ with browser commands (drag, waitStable, focus/motion emulation), setup, and shared utilities

Changes

Area What
Dependencies @vitest/browser-playwright, @testing-library/vue, jsdom added to catalog
Config vitest.config.ts → unit project, new vitest.browser.config.ts → browser project
Root config Updated to reference both package configs
Test infra packages/0/test/ — commands.ts, setup.ts, globals.d.ts, index.ts
Renames 30 component tests: index.test.tsindex.browser.test.ts
Cleanup Removed showPopover/hidePopover/showModal mocks, removed happy-dom comments
Scripts Added test:unit, test:browser, test:open to packages/0

Test plan

  • pnpm vitest run --project v0:unit — 75 files, 2976 tests passing
  • pnpm vitest run --project v0:browser — 30 component test files (requires Playwright chromium; cannot verify in WSL)
  • pnpm typecheck — clean
  • pnpm lint:fix — clean

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 4, 2026

Open in StackBlitz

commit: 4d91efe

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.

1 participant