test(frontend): extend notebook-migration LLM unit test coverage - #6781
Conversation
Add 11 tests covering the feature-flag guard, verifyConnection (disabled/uninitialized/ success/error), the default-token fallback, the not-initialized guards, the missing edges/outputs response fallbacks, and close(). Coverage 78% -> ~100%.
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
Pull request overview
This PR extends the frontend unit test coverage for NotebookMigrationLLM (notebook-to-workflow migration), adding targeted tests for feature-flag gating, initialization/guard behavior, connection verification, response-shape tolerances, and session teardown.
Changes:
- Added coverage for feature-flag disabled behavior across
initialize(),verifyConnection(), andconvertNotebookToWorkflow(). - Added tests for initialization defaults (Auth token fallback), not-initialized guardrails, and
close()behavior. - Added a response-shape tolerance test for missing
edges/outputskeys in the LLM workflow response.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…llm spec Rename the test to reflect that AuthService.getAccessToken() returns null so the access token defaults to an empty string via the ?? fallback.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6781 +/- ##
============================================
+ Coverage 75.20% 75.25% +0.05%
- Complexity 3446 3449 +3
============================================
Files 1160 1160
Lines 45807 45807
Branches 5071 5071
============================================
+ Hits 34449 34473 +24
+ Misses 9746 9731 -15
+ Partials 1612 1603 -9
*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:
|
What changes were proposed in this PR?
Extends
migration-llm.spec.tswith 11 tests (16 -> 27), covering the feature-flag/assertEnabled guard,verifyConnection(disabled/not-initialized/success/error-catch), theinitialize()default-token fallback, the not-initialized guards onsendPrompt/convertNotebookToWorkflow, the missing edges/outputs response-shape fallbacks, andclose(). Coverage 78% -> ~100% (19 -> 1 uncovered; the residual is the documented network transport seam). No existing tests modified.Any related issues, documentation, discussions?
Closes #6775.
How was this PR tested?
ng test --include='**/migration-llm.spec.ts'-> 27/27 passing.yarn format:cipasses.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])