test(frontend): add unit tests for ReportGenerationService#6471
Open
Ma77Ball wants to merge 4 commits into
Open
test(frontend): add unit tests for ReportGenerationService#6471Ma77Ball wants to merge 4 commits into
Ma77Ball wants to merge 4 commits into
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6471 +/- ##
============================================
+ Coverage 70.20% 70.36% +0.15%
Complexity 3390 3390
============================================
Files 1142 1142
Lines 44844 44871 +27
Branches 4949 4955 +6
============================================
+ Hits 31484 31572 +88
+ Misses 11725 11662 -63
- Partials 1635 1637 +2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Vitest unit test suite for the frontend ReportGenerationService to improve confidence in report generation behaviors without modifying production code.
Changes:
- Added
report-generation.service.spec.tscovering AI prompt construction for comment + summary generation. - Added coverage for operator-result HTML generation for: missing result service, empty paginated results, non-empty paginated results (table), and paginated-service error handling.
- Added coverage for the workflow snapshot precondition error when
#workflow-editoris missing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+100
to
+107
| describe("generateWorkflowSnapshot", () => { | ||
| // The rendering path delegates to html2canvas (unmockable reliably under the | ||
| // shared module registry), so only the pre-render guard is pinned here. | ||
| it("errors when the #workflow-editor element is absent", () => { | ||
| let error: unknown; | ||
| service.generateWorkflowSnapshot("wf").subscribe({ error: (e: unknown) => (error = e) }); | ||
| expect(error).toEqual("Workflow editor element not found"); | ||
| }); |
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.
What changes were proposed in this PR?
Any related issues, documentation, discussions?
Closes: #6459
How was this PR tested?
cd frontend && npx nx test gui --include="**/report-generation.service.spec.ts", expect 10 passed.yarn test:ci, selected by the auto-appliedfrontendlabel.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF