Add unit tests for isStageRunning - #7316
Conversation
Signed-off-by: vikash7485 <vikkiraj073@gmail.com>
✅ Deploy Preview for pipecd-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🟢 Approval recommended
The added tests match the current isStageRunning implementation and provide full coverage across the existing StageStatus enum values without changing runtime behavior.
Pull request overview
This PR adds Jest unit test coverage for the isStageRunning utility used by the web deployment log viewer to decide whether the log component should be in a “loading” state based on the stage status.
Changes:
- Add a new parameterized unit test (
it.each) covering allStageStatusenum values forisStageRunning.
File summaries
| File | Description |
|---|---|
| web/src/utils/is-stage-running.test.ts | Adds table-driven tests asserting isStageRunning behavior for every StageStatus value. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7316 +/- ##
===========================================
+ Coverage 29.75% 40.72% +10.97%
===========================================
Files 601 59 -542
Lines 64442 4788 -59654
===========================================
- Hits 19172 1950 -17222
+ Misses 43778 2740 -41038
+ Partials 1492 98 -1394
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thank you for contributing to PipeCD, @vikash7485! The changes in this pull request will be part of the upcoming release! |
What this PR does:
Adds comprehensive unit tests for the
isStageRunningutility function (web/src/utils/is-stage-running.test.ts).Why we need it:
isStageRunningis a core utility used by the deployment detail log-viewer (web/src/components/deployments-detail-page/log-viewer/index.tsx) to determine whether an active stage is currently in progress or waiting, controlling the log loading indicator. It lacked automated test coverage across its enum state transitions.Does this PR introduce a user-facing change?:
No.