Skip to content

test(web): add unit tests for isDeploymentRunning utility - #7145

Open
vikash7485 wants to merge 2 commits into
pipe-cd:masterfrom
vikash7485:test/add-coverage-for-is-deployment-running
Open

test(web): add unit tests for isDeploymentRunning utility#7145
vikash7485 wants to merge 2 commits into
pipe-cd:masterfrom
vikash7485:test/add-coverage-for-is-deployment-running

Conversation

@vikash7485

Copy link
Copy Markdown

What this PR does:

Add unit tests for isDeploymentRunning in web/src/utils/is-deployment-running.ts, covering all 7 DeploymentStatus enum values and the undefined edge 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)
    • Pipeline component (determines if stages are interactive)
      Without tests, future enum additions to DeploymentStatus could 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.

  • How are users affected by this change: No user-facing impact.
    • Is this breaking change: No.
    • How to migrate (if breaking change): N/A.

@github-actions

Copy link
Copy Markdown
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-off

All commits must include a Signed-off-by line to comply with the Developer Certificate of Origin (DCO).

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-lease

For multiple commits:

git rebase --signoff origin/master
git push --force-with-lease

Run checks locally

Before pushing updates, please run:

make check

This 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.
You can get your Slack invite from: https://communityinviter.com/apps/cloud-native/cncf

Thanks for contributing to PipeCD! ❤️

@vikash7485
vikash7485 force-pushed the test/add-coverage-for-is-deployment-running branch from 06031c3 to 5778eb8 Compare August 10, 2026 10:26
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
vikash7485 force-pushed the test/add-coverage-for-is-deployment-running branch from 2ffa638 to f5ccc5b Compare August 11, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant