test: add unit tests for CheckSummaryService#1525
Conversation
|
@tmdeveloper007 is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThis PR introduces a comprehensive Jest test suite for the ChangesCheckSummaryService generateSummary Tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🎉 Thanks for your contribution, @tmdeveloper007!Your PR has passed our automated GSSoC quality checks. Here's a quick summary:
A maintainer will review your PR soon. Please be patient and available for feedback. 💪 GSSoC'26 automation · Maintainer: @nisshchayarathi |
1 similar comment
🎉 Thanks for your contribution, @tmdeveloper007!Your PR has passed our automated GSSoC quality checks. Here's a quick summary:
A maintainer will review your PR soon. Please be patient and available for feedback. 💪 GSSoC'26 automation · Maintainer: @nisshchayarathi |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/services/__tests__/check-summary.test.ts (1)
32-52: 💤 Low valueOptionally assert the FAIL evaluation message is rendered.
The WARN test (Line 70) verifies the evaluation message surfaces for non-PASS statuses, but this FAIL case never asserts
"Secret detected in code"appears intext. Adding it closes the symmetry and guards the FAIL rendering path.♻️ Optional coverage addition
expect(result.text).toContain("**Reason:**"); expect(result.text).toContain("Security violations detected"); + expect(result.text).toContain("Secret detected in code");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/services/__tests__/check-summary.test.ts` around lines 32 - 52, The FAIL test in lib/services/__tests__/check-summary.test.ts should also assert that the evaluation message is rendered: update the "should generate failure summary for blocking policy" test that calls CheckSummaryService.generateSummary(policyOutput) to include an expectation that result.text contains the evaluation message "Secret detected in code" (similar to the WARN test), ensuring the FAIL evaluation message from the evaluations array is asserted.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@lib/services/__tests__/check-summary.test.ts`:
- Around line 32-52: The FAIL test in
lib/services/__tests__/check-summary.test.ts should also assert that the
evaluation message is rendered: update the "should generate failure summary for
blocking policy" test that calls
CheckSummaryService.generateSummary(policyOutput) to include an expectation that
result.text contains the evaluation message "Secret detected in code" (similar
to the WARN test), ensuring the FAIL evaluation message from the evaluations
array is asserted.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7878e60c-3bcd-4661-a266-bb04c6a8666f
📒 Files selected for processing (1)
lib/services/__tests__/check-summary.test.ts
Summary
Closes #1515
Summary by CodeRabbit