test: add coverage for tokens, castHelpers, useResizable, tutorialsData, vaultSwitch - #4210
Conversation
…ta, vaultSwitch Cover five previously untested modules with 73 new test cases: - ui_primitives/tokens: design token constants and reducedMotion helper - demo/castHelpers: synthetic cast builder functions - hooks/useResizable: pointer-based resize hook - tutorials/tutorialsData: tutorial registry and getTutorial lookup - electron/vaultSwitch: vault switch orchestration sequence Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
georgi
left a comment
There was a problem hiding this comment.
CI is failing — typecheck and quality gate are red. PR #4212 (same base SHA 021ec36) passes typecheck, so these failures are introduced by this PR, not pre-existing.
The new tests (73 across 5 files) look well-structured. Please fix the typecheck errors and push an update.
Generated by Claude Code
|
@claude fix typechecks |
|
Claude finished @georgi's task in 1m 48s —— View job Fixing typecheck errors
The CI failure was two Fix: Changed |
The `style` property on the mock element was `{ width: "", height: "" }`,
which is incompatible with the full CSSStyleDeclaration type required by
`Partial<HTMLElement>`. Changed createMockRef to accept `Record<string, unknown>`
since the element is cast to HTMLElement anyway.
Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
georgi
left a comment
There was a problem hiding this comment.
The new tests look well-structured — 73 tests covering previously untested modules (design tokens, cast helpers, useResizable, tutorials data, vault switch).
However, the Quality Gate CI checks (typecheck, test-app, test-packages, lint, build) did not run — only CodeQL/Analyze ran. Cannot merge without a full CI pass.
Please rebase onto main to trigger a full CI run. The base SHA is behind current main (3 PRs were just merged).
Generated by Claude Code
georgi
left a comment
There was a problem hiding this comment.
All 73 tests look well-structured and correct — tokens, castHelpers, useResizable, tutorialsData, and vaultSwitch are all properly tested with no flakiness vectors. No conflicts with recently merged PRs.
However, the Quality Gate CI (lint, typecheck, test-app, test-packages) never ran — only CodeQL/Analyze. The PR's base is stale (021ec367 vs current main). Please rebase onto main to trigger the full CI pipeline. No merge conflicts are expected.
Generated by Claude Code
Summary
web/src/components/ui_primitives/__tests__/tokens.test.ts— 23 tests for design token constants (FONT_WEIGHT,FONT_SIZE_SANS,FONT_SIZE_MONO,TYPOGRAPHY,MOTION,Z_INDEX,BORDER_RADIUS) and thereducedMotionhelperweb/src/demo/__tests__/castHelpers.test.ts— 23 tests for the synthetic demo cast builder functions (propType,prop,out,meta,node,edge,castMessageswith stream/progress)web/src/hooks/__tests__/useResizable.test.ts— 7 tests for the pointer-based resize hook (ref stability, direction handlers, pointer capture, button filtering)web/src/components/tutorials/__tests__/tutorialsData.test.ts— 13 tests for tutorial data integrity (required fields, unique ids, path formats, accent colors) andgetTutorialfallback logicelectron/src/__tests__/vaultSwitch.test.ts— 7 tests for the vault switch orchestration (correct step sequence, delay timing, all dependencies called)Total: 73 new tests across 5 files, covering previously untested modules.
Test plan
npx jestin web and electron)npm run lint)npm run test)🤖 Generated with Claude Code