Skip to content

web: add @vitest/coverage-v8 and close the component test gap — 22 of 26 components have zero tests #150

Open

Description

@falbany

Problem

The Python side enforces --cov-fail-under=85, but the web suite has no coverage provider at all — npm test -- --coverage fails with "missing @vitest/coverage-v8". AGENTS.md's ">85% coverage" target is unenforceable for src/profiles/web (extends #41, which added the test infra, and #48, which gates CI).

Tested today: ConfigEditorModal, CopyableUrl, MarkdownMessage, SaveAsDialog, StatusBar, WorkflowRunnerModal, App.configEditor (editor slice only), utils barcodeDecoder/configDrop/fileProperties/searchSyntax/theme/useModalA11y, api/client.

Untested (22 components): ActionBar, BarcodeModal, CameraBarcodeModal, ConfirmDialog, ContextMenu, DirectoryPickerModal, DropConfigOverlay, EditableCombobox, ErrorBoundary, FileListTable, FilePropertiesModal, FilterSyntaxHelper, HeaderBar, InitErrorPanel, LoadConfigModal, LogViewerModal, ScanStatusStrip, SearchBar, ShortcutsModal, SingleMatchPromptModal, TimerModal, Tooltip. Untested utils: exportCsv.ts, barcodeScanner.ts.

Smell: ConfigEditorModal.test.tsx:1083,1142 asserts on raw stylesheet text — readFileSync(join(process.cwd(), "src", "index.css"), "utf8") — coupling tests to CSS string content (any reformat breaks the suite) and to the cwd.

Suggested fix

  1. Add @vitest/coverage-v8, a "test:coverage" script and a coverage block in vitest.config.ts (include src/**, exclude *.test.* and dist); reference it in the future CI web job (CI: no workflow runs tests or lint — add a quality gate (pytest, ruff, pylint, coverage, web build) #48).
  2. Prioritize behavior-bearing untested components for tests: EditableCombobox, DirectoryPickerModal, LoadConfigModal, DropConfigOverlay, FileListTable.
  3. Replace the CSS readFileSync assertions with class-presence/behavior assertions or delete them.

Activity

  1. added
    code-quality
    frontend
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityfrontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions