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

Đang mở
#150 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, react, typescript
Lĩnh vực
testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Python
Star
1
Fork
1
Merge trung bình
4 giờ 46 phút
Pull request đã merge (30 ngày)
55

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của falbany/ProFiles

Tất cả issue của falbany/ProFiles

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.