Skip to content

Coverage thresholds have no headroom #57

In review

Description

@vadim9999

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

  1. 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).
  2. 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: Element
    • TemplateTree/AddElementForm › does not submit without a type: Found multiple elements with the text: /required/i
    • Elements/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:coverage is green.
  • coverage.thresholds in vitest.config.mts raised 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%

Activity

  1. added
    enhancement
    on Nov 24, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions