Skip to content

test(app): comprehensive test coverage improvements#56

Merged
pasrom merged 3 commits intomainfrom
test/comprehensive-coverage
Mar 21, 2026
Merged

test(app): comprehensive test coverage improvements#56
pasrom merged 3 commits intomainfrom
test/comprehensive-coverage

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented Mar 21, 2026

Summary

  • Snapshot testing via PointFree's swift-snapshot-testing for MenuBarIcon visual regression (29 reference images covering all badge states + animation frames)
  • Pure function extraction from SpeakerNamingView (buildSpeakerMapping, unusedParticipants, computeInitialNames) and MeetingTranscriberApp (shouldAutoWatch, lastCompletedProtocolPath)
  • Layout-math unit tests for MenuBarIcon.barsLayout/textLayout
  • Comprehensive test coverage for previously untested components
  • Docs update for Parakeet and Qwen3 transcription engines
  • Workflow integration test plan for full pipeline coverage (next PR)

Metrics

Metric Before After
Tests 701 725
Line Coverage (app) ~70.3% ~72.1%
MenuBarIcon coverage 34% 100%

Test plan

  • swift test — 725 tests, 0 failures
  • ./scripts/lint.sh — 0 serious violations
  • Snapshot reference images committed for regression detection

@github-actions github-actions bot added the chore Maintenance or non-functional changes label Mar 21, 2026
pasrom added 3 commits March 21, 2026 22:02
What: Add ~83 new test cases across 17 files (5 new, 12 extended),
bringing total from 618 to 701.

New test files:
- PermissionRowTests: ViewInspector tests for icon/color/help logic
- MicRecorderTests: initial state + error description coverage
- PermissionsTests: smoke tests for permission check functions
- AudioConstantsTests: targetSampleRate constant verification
- AppMeetingPatternTests: forAppName lookup, pattern counts, dimensions

Extended test coverage:
- PipelineQueue: MockEngine-based processing, diarization path,
  dual-source transcription, speaker naming handler/rerun/skip,
  snapshot recovery for all in-progress states
- WatchLoop: manual recording state, clean title edge cases
- AppState: engine fallback, settings-to-queue wiring
- UpdateChecker: periodic checks, error clearing
- SettingsView: engine/permissions/about sections
- SpeakerNamingView: rerun button, formatted time, play button
- AppPickerView: TextField, empty state
- MenuBarView: error jobs, multiple jobs
- DiarizationProcess: text/timestamp preservation, dual-track sorting
- SpeakerMatcher: single-speaker match, DB dedup, empty input
- ProtocolGenerator: all ProtocolError + RecorderError descriptions
…erage

What: Add SnapshotTesting (PointFree) dependency, snapshot tests for
MenuBarIcon, layout-math unit tests, pure function extraction from
SpeakerNamingView and MeetingTranscriberApp, and tests for all extracted
functions. 24 new tests total (701 → 725).

Reasoning:
- Problem: ~30% uncovered code is UI (animations, View lifecycle, system
  APIs) that ViewInspector and XCTest cannot reach
- Considered: XCUITests (need Xcode project, not SPM-compatible),
  increasing ViewInspector coverage (limited for AppKit rendering)
- Decision: Two-pronged approach — snapshot regression testing for visual
  output (MenuBarIcon renders NSImage directly), and pure function
  extraction to make logic testable without driving the UI

Changes:
- Package.swift: add swift-snapshot-testing dependency
- MenuBarIcon.swift: barsLayout/textLayout from private → internal
- SpeakerNamingView.swift: extract buildSpeakerMapping, unusedParticipants,
  computeInitialNames as static functions
- MeetingTranscriberApp.swift: extract shouldAutoWatch, lastCompletedProtocolPath
- 29 snapshot reference images for all badge states + animation frames
Covers happy paths (single-source, dual-source, diarization + naming),
error scenarios (empty transcript, engine/protocol failure), speaker
naming edge cases (skip, rerun), and multi-job sequential processing.
~12 new integration tests planned.
@pasrom pasrom force-pushed the test/comprehensive-coverage branch from 7afe405 to f6f3e44 Compare March 21, 2026 21:02
@pasrom pasrom merged commit 4fc4d0b into main Mar 21, 2026
6 checks passed
@pasrom pasrom deleted the test/comprehensive-coverage branch March 21, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance or non-functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant