test: close mutation coverage gaps for main.tsx, SelectDialog, NotificationToast; exclude real-agent-core-loaders.ts - #270
Merged
tbrandenburg merged 1 commit intoAug 31, 2026
Conversation
…cationToast; exclude real-agent-core-loaders.ts Adds dedicated unit tests for three renderer modules and one Stryker config exclusion, resolving 4 open mutation-gap issues: - main.tsx: 0% -> 100% (7/7 mutants killed). Tests the module's one real branch (throw when #root is missing) plus the createRoot/render happy path, with react-dom/client and ./App mocked to isolate the bootstrap logic. - SelectDialog.tsx: 0% -> 100% (17/17 mutants killed). Modeled directly on the existing ConfirmDialog.test.tsx sibling pattern. - NotificationToast.tsx: 0% -> 100% (18/18 mutants killed). Covers all three tone-class branches (error/warning/default) and dismissal. - real-agent-core-loaders.ts: excluded from Stryker's mutate glob, following the existing index.ts/windows.ts precedent. This is a test-support re-export helper with no independent branching logic -- it exists only to let Vitest's ESM-aware transform load real @earendil-works/pi-agent-core symbols directly. Testing it would mean mocking the real library just to assert a wrapper calls through, which defeats its purpose. Closes #254, #225, #224, #223
|
tbrandenburg
deleted the
fix/mutation-gaps-main-tsx-select-dialog-notification-toast-agent-core-loaders
branch
August 31, 2026 06:25
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
Resolves 4 open
mutation-gapissues.src/renderer/main.tsxsrc/renderer/components/SelectDialog.tsxConfirmDialog.test.tsxsibling)src/renderer/components/NotificationToast.tsxsrc/main/agent/test-support/real-agent-core-loaders.tsWhy #223 got a config exclusion instead of a test
real-agent-core-loaders.tsis a test-support re-export helper that trivially forwards real@earendil-works/pi-agent-coresymbols via a normal static import (so Vitest's ESM-aware transform can load them directly). It has zero independent branching logic of its own. Testing it would mean mocking@earendil-works/pi-agent-corejust to assert the wrapper calls through, which defeats its entire purpose — letting tests exercise the REAL, unmocked library. This follows the exact precedent already established instryker.config.mjsforsrc/main/index.ts/src/main/windows.ts(Electron bootstrap glue with no branching logic to mutate, verified via real packaged-app CDP checks instead of unit tests).Follow-up issue filed
While investigating #223, found
src/main/agent/test-support/real-coding-agent-loaders.tshas the identical trivial-re-export shape and will very likely need the same exclusion treatment. Filed as #269 rather than fixed here, since it's a distinct file outside this PR's assigned scope.Validation commands run
Risks / follow-ups
src/main/model/**test failures as noted in test: close mutation coverage gaps for zoom, theme-init, desktop-api, credential-gated-providers #268, confirmed unrelated (untouched by this branch's diff).real-coding-agent-loaders.ts's identical mutation-gap pattern.Closes #254
Closes #225
Closes #224
Closes #223