Repository navigation
In review
Labels
enhancementNew feature or request
Description
Problem
Coverage on master is less than 2 points above every threshold in vitest.config.mts:
| Metric | master (after #56) |
Threshold | Headroom |
|---|---|---|---|
| Lines | 86.04 | 85 | 1.04 |
| Statements | 84.19 | 83 | 1.19 |
| Functions | 79.69 | 79 | 0.69 |
| Branches | 76.84 | 75 | 1.84 |
Any PR that adds logic without tests can fail test.yml. Meanwhile, the gains from new tests are not locked in, so coverage can slip back without CI noticing.
Proposal
- Add tests for the components that have little direct coverage (Add unit tests for API error edges and Antd form components #55: Elements and TemplateTree forms,
errorMessage,notifyError). - Then raise the thresholds to the new floor (a ratchet), so these gains stay.
#55 on its own (base before #56, with 4 tests failing) measures: lines 86.12, statements 84.64, functions 81.5 (+1.9), branches 75.39 (no change).
Acceptance criteria
- All tests in Add unit tests for API error edges and Antd form components #55 pass on CI. Currently failing:
TemplateTree/AddElementForm› loads library elements and submits an element node with placeholder fills:Found multiple elements with the title: ElementTemplateTree/AddElementForm› does not submit without a type:Found multiple elements with the text: /required/iElements/AddElementForm› resets the fields:expect(element).toHaveValue()Elements/EditElementForm› resets back to the original values:expect(element).toHaveValue("Header")
- Rebased on
master;npm run test:coverageis green. -
coverage.thresholdsinvitest.config.mtsraised to the measured values rounded down to a whole number. No threshold goes down.
Area
Tests (Vitest, coverage thresholds)
Out of scope
Weak spots that #55 does not touch. They are tracked in #58:
src/ai/providers.ts:createModel,fetchWithTimeout(branches 28.57%)src/ai/tools.ts: lines 534–589 (branches 69.36%)src/editor/Main/Chat/ChatPanel.tsx: functions 51.61%src/editor/Main/TemplateTree/TemplateTree.tsx: branches 64.28%
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity