Skip to content

test(gui): RTL sprint Phase 1 — pure component tests + infrastructure - #57

Merged
CameronBrooks11 merged 2 commits into
mainfrom
chore/gui-rtl-sprint
Apr 16, 2026
Merged

CameronBrooks11 merged 2 commits into
mainfrom
chore/gui-rtl-sprint

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Add RTL test infrastructure and Phase 1 tests covering all pure/panel components. 30 test files, 379 tests passing, thresholds raised.

Infrastructure (src/tests/):

  • storeUtils.ts: Zustand store seed/reset helpers
  • renderWithProviders.tsx: RTL render wrapper with mocked CliHealthContext
  • tauriMocks.ts: typed Tauri mock factories (invoke, events, dialogs, shell, app)

Phase 1 test files:

  • panels/panels.test.tsx: BottomPanel, LeftPanel, RightPanel
  • layouts/MainLayout.test.tsx: all 4 layout slots
  • components/TabBar.test.tsx: tab switching + active class
  • components/Toast/ToastContainer.test.tsx: toast display + dismiss
  • components/ErrorBoundary.test.tsx: error boundary happy/error paths
  • components/dialogs/BaseDialog.test.tsx: portal, overlay, close, footer
  • components/canvas/CanvasControls.test.tsx: all 5 buttons + isGenerating
  • components/canvas/LayerScrubber.test.tsx: null guard, labels, range input
  • components/layers/LayerRow.test.tsx: icons, summaries, active class, callbacks
  • components/StreamTab/KeyboardShortcuts.test.tsx: sections, close, overlay

Config:

  • tsconfig.json: add @testing-library/jest-dom to types
  • vitest.config.ts: raise thresholds (lines 47, fns 80, branches 82, stmts 47)

Add RTL test infrastructure and Phase 1 tests covering all pure/panel
components. 30 test files, 379 tests passing, thresholds raised.

Infrastructure (src/tests/):
- storeUtils.ts: Zustand store seed/reset helpers
- renderWithProviders.tsx: RTL render wrapper with mocked CliHealthContext
- tauriMocks.ts: typed Tauri mock factories (invoke, events, dialogs, shell, app)

Phase 1 test files:
- panels/panels.test.tsx: BottomPanel, LeftPanel, RightPanel
- layouts/MainLayout.test.tsx: all 4 layout slots
- components/TabBar.test.tsx: tab switching + active class
- components/Toast/ToastContainer.test.tsx: toast display + dismiss
- components/ErrorBoundary.test.tsx: error boundary happy/error paths
- components/dialogs/BaseDialog.test.tsx: portal, overlay, close, footer
- components/canvas/CanvasControls.test.tsx: all 5 buttons + isGenerating
- components/canvas/LayerScrubber.test.tsx: null guard, labels, range input
- components/layers/LayerRow.test.tsx: icons, summaries, active class, callbacks
- components/StreamTab/KeyboardShortcuts.test.tsx: sections, close, overlay

Config:
- tsconfig.json: add @testing-library/jest-dom to types
- vitest.config.ts: raise thresholds (lines 47, fns 80, branches 82, stmts 47)
Local Windows v8 reports inflated branch/function numbers vs CI Linux.
Set thresholds from actual CI numbers (lines 50.59, fns 49.62, branches 32.85).
Also exclude wind-schema.ts which fails binary parse on CI rolldown.
@CameronBrooks11
CameronBrooks11 merged commit b538fa4 into main Apr 16, 2026
12 checks passed
@CameronBrooks11
CameronBrooks11 deleted the chore/gui-rtl-sprint branch April 16, 2026 01:21
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