Skip to content

Test coverage: stores at 100% (uiStore + chatStore)#18

Closed
hh54188 wants to merge 1 commit intomasterfrom
coverage-improvement-20251002-155106
Closed

Test coverage: stores at 100% (uiStore + chatStore)#18
hh54188 wants to merge 1 commit intomasterfrom
coverage-improvement-20251002-155106

Conversation

@hh54188
Copy link
Owner

@hh54188 hh54188 commented Oct 2, 2025

Summary

  • Achieved 100% line/function/branch coverage for store files (src/stores/**/*.js).
  • Addressed the last uncovered line in src/stores/uiStore.js (setter for testModalVisible).

What changed

  • Updated src/tests/stores/uiStore.test.js to include comprehensive tests for setTestModalVisible and included assertions for testModalVisible in the resetUIState flow.
  • Verified coverage with npm run test:stores:coverage which reports 100% across uiStore.js and chatStore.js.

Evidence

  • Local run in the GitHub Actions runner:
% Coverage report from v8
--------------|---------|----------|---------|---------|-------------------
All files     |     100 |      100 |     100 |     100 |
 chatStore.js |     100 |      100 |     100 |     100 |
 uiStore.js   |     100 |      100 |     100 |     100 |
--------------|---------|----------|---------|---------|-------------------

Reasoning

  • The uncovered analysis (uncovered-analysis.json) identified line 86 in src/stores/uiStore.js as uncovered: state.testModalVisible = visible;.
  • Existing tests covered all other modal setters; we followed the established pattern to add symmetrical tests for the test modal.
  • We also asserted that resetUIState resets testModalVisible to false to exercise that path.

How to validate

  1. Run npm ci (if needed) and ensure vitest is available.
  2. Execute npm run test:stores:coverage.
  3. Confirm coverage results are 100% for stores.

Notes

  • No production code changes; tests only.
  • No new files added; only modified existing test file per requirements.

Covers the previously uncovered setter in `useUIStore` by adding focused tests and integrating it into the reset flow assertions. Verified with vitest coverage: 100% lines, functions, branches for store files.
@hh54188 hh54188 closed this Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant