Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 12, 2025

Adds initial Jest+jsdom browser UI tests (real backend), organized by product section, and keeps test setup UI-driven (minimizing direct backend calls).

  • Organize browser tests under tests/browser/{app,projects,workspaces,settings}
  • Keep harness helpers under tests/browser/harness/
  • Create workspaces via UI (ChatInput creation flow) instead of direct oRPC calls
  • Configure providers/models via Settings UI (no backend seeding)

Validation:

  • make static-check
  • TEST_INTEGRATION=1 bun x jest tests/browser/ --runInBand

Generated with mux

@ammar-agent ammar-agent force-pushed the integration-harness-0sjr branch from b536a37 to 9bce96c Compare December 12, 2025 05:26
Add browser test infrastructure for React components with real oRPC backend:

- tests/browser/setup.ts: BrowserTestEnv with real ServiceContainer
- tests/browser/renderWithBackend.tsx: React Testing Library integration
- tests/browser/uiHelpers.tsx: UI interaction helpers (add project, select workspace, etc.)
- tests/browser/global-setup.js: jsdom polyfills (streams, fetch, timers)

Tests (15 passing):
- appLoader.test.tsx: App loading, sidebar expansion, multi-project
- projectManagement.test.tsx: Add/remove projects, workspace creation/removal

Mocks required for jsdom/Vite compatibility:
- styleMock.js: CSS imports
- svgMock.js: Vite ?react SVG imports
- version.js: Build-time generated module
- highlightWorkerClient.js: Worker URL imports
- chalk.js, jsdom.js: Node module compatibility

Run with: TEST_INTEGRATION=1 bun x jest tests/browser/

_Generated with mux_
- Stop modifying LoadingScreen (use visible loading text instead)
- Ensure ServiceContainer shutdown/dispose during test cleanup
- Wrap unmounts in act() and set IS_REACT_ACT_ENVIRONMENT
- Add jsdom polyfill for ResizeObserver
- Add browser-ui Jest setup to suppress act warning noise and raise
  EventEmitter listener limit for full-app mounts
- Keep forceExit enabled to avoid Jest hangs from lingering jsdom handles

_Generated with mux_
@ammar-agent ammar-agent force-pushed the integration-harness-0sjr branch from 48f33d4 to f9f97c8 Compare December 12, 2025 17:37
@ammar-agent ammar-agent changed the title 🤖 ci: start porting Storybook interactions to jsdom harness 🤖 ci: add browser UI tests organized by product section Dec 12, 2025
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