Skip to content

test: expand frontend coverage to 55% (+65 component/hook tests) - #124

Merged
TeFuirnever merged 1 commit into
mainfrom
feat/more-frontend-coverage
Jul 29, 2026
Merged

test: expand frontend coverage to 55% (+65 component/hook tests)#124
TeFuirnever merged 1 commit into
mainfrom
feat/more-frontend-coverage

Conversation

@TeFuirnever

Copy link
Copy Markdown
Owner

Summary

65 new component/hook integration tests. Full-src coverage: 49.3% → 54.8%.

New tests

File Tests Coverage target
hooks.test.tsx 11 useWindowDrag + usePermissions
file-import.test.tsx 8 FileImport state machine
panels.test.tsx 21 ExportPanel, ProcessingPanel, TranscriptionProgress, TextDisplay
settings-sections.test.tsx 25 (+3 skip) AboutSection, PermissionsSection, AIConfigSection

Coverage progress

  • 931 → 996 tests (+65)
  • Full src/: 49.3% → 54.8% statements
  • Threshold bumped 47→52

Verification

  • ✅ 996 pass, 3 skip, 0 fail
  • ✅ typecheck + typecheck:tests exit 0
  • ✅ lint clean
  • ✅ coverage gate passes

Adds 65 new tests across 5 files covering React components and hooks
that were previously at 0% coverage. Coverage: 49.3% → 54.8% (full src/).

New test files:
- hooks.test.tsx (11): useWindowDrag drag state + click suppression,
  usePermissions mic/accessibility grant/deny paths
- file-import.test.tsx (8): FileImport full state machine (idle→selected
  →transcribing→result/error), drag-drop, format validation
- panels.test.tsx (21): ExportPanel format buttons + error toast,
  ProcessingPanel mode select + apply, TranscriptionProgress bar/cancel,
  TextDisplay copy/paste/export callbacks
- settings-sections.test.tsx (28, 3 skipped): AboutSection update check
  flow, PermissionsSection mic/accessibility test buttons, AIConfigSection
  API key/model/temperature/preset/test/save interactions

Total: 931 → 996 tests (+65, 3 skipped). Threshold bumped 47→52 (stmts).
@TeFuirnever
TeFuirnever merged commit ce23981 into main Jul 29, 2026
1 check passed
TeFuirnever added a commit that referenced this pull request Jul 31, 2026
Roadmap hygiene pass after auditing the strategic plan against actual
git state. Three issues fixed:

1. CHANGELOG: backfill missing [1.1.0] entry. PRs #123/#124/#125
   (frontend coverage work) merged to main but never recorded in
   CHANGELOG. Documents the vitest coverage scope expansion (helpers
   only -> full src/**) and threshold bump (62->66 stmts) that caused
   the 95%->46% apparent coverage drop (same tests, wider scope).

2. README: replace hardcoded '672 tests / 95% coverage' badges with
   a dynamic CI status badge. The old numbers were stale (95% used
   the narrow ~40-file scope; full-src reality is ~46%). Coverage
   badge removed since no codecov/coveralls uploader is wired into
   CI yet — to restore, add codecov-action and link a codecov badge.
   Roadmap section numbers also de-hardcoded to 'see CI'.

3. strategic-plan-gap-analysis.md: add HISTORICAL SNAPSHOT freeze
   notice at top. README linked this as the authoritative 'full
   plan' but the doc is a 2026-05-24 snapshot with stale .js refs
   (pre ADR-010 big-bang) and outdated 97% coverage figure. Now
   points readers to follow-ups.md + CHANGELOG + ADRs as the live
   sources of truth.

Co-authored-by: woshiguanxiaoliang <woshiguanxiaoliang@noreply.gitcode.com>
TeFuirnever added a commit that referenced this pull request Jul 31, 2026
* docs: fix stale roadmap data and align version bookkeeping

Roadmap hygiene pass after auditing the strategic plan against actual
git state. Three issues fixed:

1. CHANGELOG: backfill missing [1.1.0] entry. PRs #123/#124/#125
   (frontend coverage work) merged to main but never recorded in
   CHANGELOG. Documents the vitest coverage scope expansion (helpers
   only -> full src/**) and threshold bump (62->66 stmts) that caused
   the 95%->46% apparent coverage drop (same tests, wider scope).

2. README: replace hardcoded '672 tests / 95% coverage' badges with
   a dynamic CI status badge. The old numbers were stale (95% used
   the narrow ~40-file scope; full-src reality is ~46%). Coverage
   badge removed since no codecov/coveralls uploader is wired into
   CI yet — to restore, add codecov-action and link a codecov badge.
   Roadmap section numbers also de-hardcoded to 'see CI'.

3. strategic-plan-gap-analysis.md: add HISTORICAL SNAPSHOT freeze
   notice at top. README linked this as the authoritative 'full
   plan' but the doc is a 2026-05-24 snapshot with stale .js refs
   (pre ADR-010 big-bang) and outdated 97% coverage figure. Now
   points readers to follow-ups.md + CHANGELOG + ADRs as the live
   sources of truth.

* test: v1.3.0 coverage 70% → 79% (+58 tests, near industry 80%)

Largest single-PR coverage jump: +9pp (70% → 79%). useRecording.ts
(520 lines) went from 2.67% → 87.5% — the biggest win in the repo.

New test files (58 tests):
- useRecording.test.tsx (25): start/stop recording, transcription flow,
  AI optimization, save callback, error paths, determineProcessingMode.
  Mocks MediaRecorder + AudioContext + getUserMedia in jsdom.
- model-status-indicator.test.tsx (21): all stage branches (need_download/
  downloading/loading/ready/error), progress bars, download/cancel buttons.
- app-expanded.test.tsx (9): model-ready toggleRecording, file-import mode,
  transcription result + reset, copy callback.
- settings-sections.test.tsx: unskipped 2 AboutSection tests (version +
  feature list) using container.textContent matchers.

Coverage: 69.4% → 79.0% (full src/). Threshold bumped 66→76 (stmts).
Tests: 1090 → 1148 (+58). All typecheck + lint clean.

---------

Co-authored-by: woshiguanxiaoliang <woshiguanxiaoliang@noreply.gitcode.com>
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