test: add coverage for 10 highest-risk untested modules#637
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 7, 2026
Merged
test: add coverage for 10 highest-risk untested modules#637zbigniewsobiecki merged 1 commit intodevfrom
zbigniewsobiecki merged 1 commit intodevfrom
Conversation
nhopeatall
approved these changes
Mar 7, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Solid test coverage addition for 11 high-risk untested modules. All 170 tests pass, CI is green, and the implementations correctly mirror the source code behavior.
Verified:
- Cross-referenced test assertions against source implementations (sessionState, agentMessages, trigger-check, getPRChecks, getPRComments, webhookReactionSender)
- Tests follow existing project conventions (
vi.mock(),vi.hoisted(),describe/it,beforeEachcleanup) - Module-level state modules (
sessionState,agentMessages) properly reset between tests - Error paths, edge cases, and boundary conditions are well-covered (e.g., self-authored comment skip in Jira trigger, proxy guard enforcement, concurrent tick skip in ProgressMonitor)
Minor note: The PR description says "10 new test files" but actually includes 11 — not a code issue, just a description mismatch.
aaight
pushed a commit
that referenced
this pull request
Mar 7, 2026
…state Tests from dev branch (PR #637) used old file-based signatures for writeProgressCommentId and clearProgressCommentId. Updated to match the new env-var-based API (no repoDir parameter). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zbigniewsobiecki
pushed a commit
that referenced
this pull request
Mar 7, 2026
…OMMENT_ID env var (#638) * feat(progress): replace file-based comment ID with CASCADE_PROGRESS_COMMENT_ID env var * chore: remove .cascade-progress-comment-id state file from repo The file-based progress comment ID mechanism has been replaced with the CASCADE_PROGRESS_COMMENT_ID env var. Remove the previously tracked state file and its .gitignore entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(progress): use ENV_VAR_NAME constant and add injection tests - Import ENV_VAR_NAME from progressState.ts in secretBuilder.ts and env.ts instead of hardcoding 'CASCADE_PROGRESS_COMMENT_ID' string literal - Add 5 unit tests for injectProgressCommentId covering: string ackCommentId with cardId injects, numeric ackCommentId skips, missing cardId skips, undefined ackCommentId skips, empty string ackCommentId skips Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(test): update progressMonitor.test.ts for env-var-based progress state Tests from dev branch (PR #637) used old file-based signatures for writeProgressCommentId and clearProgressCommentId. Updated to match the new env-var-based API (no repoDir parameter). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): restore .cascade-progress-comment-id in .gitignore The file may still be created by running cascade processes (e.g. the orchestrator session itself). Keeping the gitignore entry prevents it from appearing as an uncommitted change and triggering the stop hook. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Cascade Bot <bot@cascade.dev> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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
Adds 10 new test files covering the highest-risk untested modules identified in the coverage analysis:
tests/unit/triggers/config-resolver.test.ts— 20 tests coveringresolveTriggerConfigs,isTriggerEnabled,getTriggerParameters,getResolvedTriggerConfigwith DB override merging and definition fallback logictests/unit/triggers/shared/trigger-check.test.ts— 10 tests forcheckTriggerEnabledandcheckTriggerEnabledWithParamsincluding logging behaviortests/unit/gadgets/sessionState.test.ts— 16 tests forinitSessionState, getters, record functions,deleteInitialCommentwith error recovery, andgetSessionStatecopy semanticstests/unit/config/agentMessages.test.ts— 10 tests forinitAgentMessages, proxy guard enforcement (pre-init throws),getAgentLabelfallback, and_resetAgentMessagestests/unit/gadgets/github/core/getPRChecks.test.ts— 14 tests forformatCheckStatus(all icon types, edge cases) andgetPRChecksasync + error pathstests/unit/gadgets/github/core/getPRComments.test.ts— 8 tests forgetPRCommentscovering empty/populated/reply/line-omission casestests/unit/server/webhookParsers.test.ts— 13 tests forparseTrelloPayload,parseGitHubPayload,parseJiraPayloadincluding header extraction and parse failurestests/unit/server/webhookReactionSender.test.ts— 16 tests forbuildReactionSenderfor trello, github, jira, and unknown sourcestests/unit/backends/progressMonitor.test.ts— 29 tests covering constructor,start(),stop(), tick lifecycle, concurrent tick skip, PM/GitHub poster delegation, fallback on model failuretests/unit/agents/definitions/profiles.test.ts— 17 tests forgetAgentProfile(sdkTools, needsGitHubToken, filterTools, finishHooks, fetchContext, buildTaskPrompt, getLlmistGadgets) andhasFinishValidationtests/unit/triggers/jira-comment-mention.test.ts— 17 tests forJiraCommentMentionTrigger.matches()andhandle()including wiki markup and ADF mention detection, self-authored skip, trigger disabled pathTotal: 170 new tests across 10 files
Test plan
vi.mock(),vi.hoisted(),describe/itblockssessionState.ts,agentMessages.ts) properly reset between testsCard: https://trello.com/c/nHlrCbXy/174-find-top-area-that-needs-test-coverage-and-plan-new-tests
🤖 Generated with Claude Code