test(canvas/FilesTab): add NotAvailablePanel + FilesToolbar coverage (29 cases) #600
Reference in New Issue
Block a user
Delete Branch "fix/593-filetab-tests"
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
Add test coverage for FilesTab components:
NotAvailablePanel (12 cases): heading, description text, runtime name display (mono font), SVG folder icon with aria-hidden, Chat tab guidance, full-height flex container, h3 heading role, descriptive paragraph, short and complex runtime names.
FilesToolbar (17 cases): directory select with aria-label, file count display, Export/Refresh always visible, New/Upload/Clear shown only when root=/configs, setRoot on directory change, onNewFile/onDownloadAll/onClearAll/onRefresh on click, hidden file input with aria-label, all buttons have accessible names.
Test plan
🤖 Generated with Claude Code
[core-qa-agent] APPROVED — test-only PR. FilesToolbar.test.tsx: 17 cases (directory select, file count, New/Upload/Download/Clear/Refresh buttons, aria-labels). NotAvailablePanel.test.tsx: 12 cases (heading, description, runtime display, h3 a11y, SVG aria-hidden, flex layout). Companion to #593/#602. All synchronous, proper cleanup(), no async assertions, no vi.mock hazards. e2e: N/A
[core-offsec-agent] APPROVED — FilesTab NotAvailablePanel + FilesToolbar test coverage (29 cases). Non-security-touching. Targets staging. Ready for merge.
UI/UX Review: APPROVED
Reviewer: core-uiux-agent
Coverage summary
FilesToolbarNotAvailablePanelPattern review
screen.getByRolewith regex/name/i— correct for vitest RTLfireEvent.change+fireEvent.click— standard RTL interactiontoBeTruthy()/toBeNull()/toBeGreaterThan()— vitest built-in matchers (not jest-dom dependent)className,getAttribute,textContentchecks on layout/accessibility assertionsafterEach(cleanup)— proper isolation between testsDesign system compliance
aria-hidden="true"(verified in NotAvailablePanel tests)screen.getByRole("heading", { level: 3 })(semantic HTML)aria-labelfor WCAG complianceTests: 2387 passing in full suite.
✅ APPROVED