test(app): comprehensive test coverage improvements#56
Merged
Conversation
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.
7afe405 to
f6f3e44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Metrics
Test plan
swift test— 725 tests, 0 failures./scripts/lint.sh— 0 serious violations