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

Open
#150 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, react, typescript
Domain
testing

Research direction

Start with src/profiles/web/vitest.config.ts and src/profiles/web/package.json to see how the web tests and scripts are configured; the issue also names ConfigEditorModal.test.tsx and five components to prioritize. Add coverage support and tests for the listed components, then replace the stylesheet text assertions with behavior or class checks. Done means coverage runs successfully and the targeted tests cover the specified behavior.

Written by the indexing model from the issue text.

Description

code-quality frontend

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 (#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.
Dominant language
Python
Stars
1
Forks
1
Avg merge
4h 46m
Merged PRs (30d)
55

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from falbany/ProFiles

All issues in falbany/ProFiles

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.