test(web): add unit tests for isDeploymentRunning utility - #7145
Open
vikash7485 wants to merge 2 commits into
Open
test(web): add unit tests for isDeploymentRunning utility#7145vikash7485 wants to merge 2 commits into
vikash7485 wants to merge 2 commits into
Conversation
vikash7485
requested review from
Warashi,
hongky-1994,
khanhtc1202 and
t-kikuc
August 10, 2026 10:19
Contributor
|
👋 Hi @vikash7485, welcome to PipeCD and thanks for opening your first pull request! We’re really happy to have you here Before your PR gets merged, please check a few important things below. Helpful resources
DCO Sign-offAll commits must include a In case you forget to sign-off your commit(s), follow these steps: For the last commit: git commit --amend --signoff
git push --force-with-leaseFor multiple commits: git rebase --signoff origin/master
git push --force-with-leaseRun checks locallyBefore pushing updates, please run: make checkThis runs the same checks as CI and helps catch issues early. 💬 Need help?If anything is unclear, feel free to ask in this PR or join us on the CNCF Slack in the #pipecd channel. Thanks for contributing to PipeCD! ❤️ |
vikash7485
force-pushed
the
test/add-coverage-for-is-deployment-running
branch
from
August 10, 2026 10:26
06031c3 to
5778eb8
Compare
Add unit tests for all 7 DeploymentStatus enum variants (PENDING, PLANNED, RUNNING, ROLLING_BACK, SUCCESS, FAILURE, CANCELLED) plus the undefined edge case. This brings the utility from 0% to 100% branch coverage. Related: pipe-cd#6706 Signed-off-by: vikash7485 <vikkiraj073@gmail.com>
vikash7485
force-pushed
the
test/add-coverage-for-is-deployment-running
branch
from
August 11, 2026 04:02
2ffa638 to
f5ccc5b
Compare
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 this PR does:
Add unit tests for
isDeploymentRunninginweb/src/utils/is-deployment-running.ts, covering all 7DeploymentStatusenum values and theundefinededge case.Why we need it:
This utility has zero test coverage despite being a critical decision function called in:
DeploymentDetailPage(controls polling interval)DeploymentDetail(controls cancel button visibility)Pipelinecomponent (determines if stages are interactive)Without tests, future enum additions to
DeploymentStatuscould silently break polling behavior with no regression signal.Which issue(s) this PR fixes:
Fixes #6915
Does this PR introduce a user-facing change?:
No. This PR only adds test coverage for an existing utility function.