test(commands): cover the intent-router ask/chat question-threading branch - #5056
Merged
Merged
Conversation
…ranch #5036's codecov/patch flagged one partial branch in processors.ts: matchedCommand === "ask" || matchedCommand === "chat" ? command.unrecognizedText : undefined. The 3 existing #4596 integration tests only ever reroute to "blockers", so the true side (rerouting to ask/chat specifically) was never exercised -- meaning the one behavior that actually matters here (does the contributor's original free text survive the reroute into the command's own question field, instead of silently dropping it) was untested.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5056 +/- ##
=======================================
Coverage 94.13% 94.13%
=======================================
Files 465 465
Lines 39542 39542
Branches 14431 14431
=======================================
+ Hits 37222 37223 +1
Misses 1664 1664
+ Partials 656 655 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
8 tasks
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
Follow-up to #4596 (PR #5036, merged): Codecov's
codecov/patchcheck flagged one partial branch inprocessors.tsat merge time (98.80% vs the 99% target) — advisory-only for this maintainer PR, so it merged, but worth closing properly rather than leaving it.The gap:
question: matchedCommand === "ask" || matchedCommand === "chat" ? command.unrecognizedText : undefined— all 3 existing#4596integration tests only ever reroute an unrecognized mention to"blockers", so thetrueside of this ternary (rerouting toask/chatspecifically, the only two commands that take a free-text question) was never exercised. That's the one behavior in this line that actually matters: does the contributor's original text survive the reroute into the target command's ownquestionfield, or get silently dropped.Added one integration test rerouting to
askand asserting the resulting card does NOT show"No specific question was provided"(the markeraskrenders when its question is empty/undefined) — proving the text threaded through correctly.Test-only change; no production code touched.
Test plan
npm run typecheck— cleanlcov.infoinspection that the previously-0-hit branch atprocessors.ts:12516is now hit on both sidesnpm run test:coverage(full, unsharded) — 718 files / 14203 tests passed, 0 failuresnpm run test:ci(full gate) — greennpm audit --audit-level=moderate— 0 vulnerabilities