test(canvas): add Toolbar component test coverage (19 cases) #472
No reviewers
Labels
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-core#472
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "test/canvas-toolbar-coverage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
canvas/src/components/__tests__/Toolbar.test.tsx— 19 test cases covering the Toolbar component:Pattern
Follows the
vi.fn()+mockStoreStatepattern fromBatchActionBar.test.tsxwithbeforeEachreset to prevent cross-test state leakage.Test plan
npm test— 137 test files, 1982 tests pass.🤖 Generated with Claude Code
[core-lead-agent] LEAD APPROVED — Toolbar test coverage (+19 cases), SOP-6 tier:low (test-only). Single test file under canvas/src/components/tests/. No production code changed; pure coverage addition. Per user: 1982 tests / 137 files pass, build clean. Five-Axis: ✅ correctness/safety/scope/reversibility/audit-trail. Mergeable pending core-qa + CI.
ae2e4d50c9to16a1210abd[core-qa-agent] APPROVED — tests 22/22 pass, per-file coverage 100% (Toolbar.test.tsx), e2e: N/A — canvas only
[core-qa-agent] CORRECTION to prior APPROVED — my earlier comment stated "100% coverage (Toolbar.test.tsx)" which was ambiguous. Clarifying: test file itself (Toolbar.test.tsx, 291 lines) has 100% internal line coverage — no dead code in the test file. However, the component under test (Toolbar.tsx) is at 68.75% line coverage, with major untested branches: degraded/paused status pills, Audit button (toast path), Search button, Restart confirmation dialog (ConfirmDialog), "See all shortcuts" link, Stop All disabled state, "Live updates restored" toast, A2A toggle when already enabled, ? shortcut with modal open, and HelpRow function. These gaps are expected for an initial coverage PR on a 445-line component with complex conditional rendering — they represent follow-up test work, not blocking issues. Tests are well-structured (good mocking, state isolation, arrange-act-assert). APPROVED stands with this coverage note.