Skip to content

Add unit tests for health & application set status - #290

Merged
keithchong merged 1 commit into
redhat-developer:mainfrom
trdoyle81:GITOPS-10536-console-plugin-status-tests
Sep 2, 2026
Merged

Add unit tests for health & application set status#290
keithchong merged 1 commit into
redhat-developer:mainfrom
trdoyle81:GITOPS-10536-console-plugin-status-tests

Conversation

@trdoyle81

Copy link
Copy Markdown
Member

Adding unit tests for Health, Sync, and ApplicationSet status UI

covers:
-Health: Suspended, Missing, undefined, unrecognised icon
-Sync: undefined status
-ApplicationSet: Healthy / Error / Unknown / empty

Jira:
GITOPS-10536

Note:
Will need to be ported to release-4.18 aswell.

Run tests:
$ pnpm test
$ pnpm test -- src/gitops/Statuses/HealthStatus.test.tsx src/gitops/Statuses/SyncStatus.test.tsx src/gitops/Statuses/ApplicationSetStatus.test.tsx

Signed-off-by: trdoyle <trdoyle@redhat.com>
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: c3225070-9c8a-4f13-b6c7-c309f9f2f7b0

📥 Commits

Reviewing files that changed from the base of the PR and between 91a5f1e and 25a385f.

📒 Files selected for processing (5)
  • src/gitops/Statuses/ApplicationSetStatus.test.tsx
  • src/gitops/Statuses/ApplicationSetStatus.tsx
  • src/gitops/Statuses/HealthStatus.test.tsx
  • src/gitops/Statuses/SyncStatus.test.tsx
  • src/gitops/components/shared/ApplicationSetList.tsx

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added status display for ApplicationSets, including health icons and labels for healthy, error, and unrecognized statuses.
  • Bug Fixes

    • Improved handling of missing, suspended, undefined, and unrecognized health or sync statuses with appropriate fallback displays.
  • Tests

    • Added coverage for ApplicationSet, health, and sync status rendering across supported and fallback states.

Walkthrough

The change adds a shared ApplicationSetStatus component, integrates it into ApplicationSetList, and adds tests for ApplicationSet, health, and sync status edge cases.

Changes

ApplicationSet status rendering

Layer / File(s) Summary
Shared status component and integration
src/gitops/Statuses/ApplicationSetStatus.tsx, src/gitops/components/shared/ApplicationSetList.tsx, src/gitops/Statuses/ApplicationSetStatus.test.tsx
ApplicationSetStatus maps known and unknown statuses to icons and renders the status text. ApplicationSetList uses the shared component. Tests cover healthy, error, unknown, and empty statuses.
Status fallback coverage
src/gitops/Statuses/HealthStatus.test.tsx, src/gitops/Statuses/SyncStatus.test.tsx
Tests cover suspended, missing, undefined, and unrecognized health statuses, plus an undefined sync status.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 25a38

The PR adds coverage for health, sync, and ApplicationSet status behavior with localized UI changes; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding unit tests for health and ApplicationSet status UI.
Description check ✅ Passed The description directly matches the changes and lists the covered Health, Sync, and ApplicationSet status cases.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5 files.


Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 12.76%. Comparing base (3bd1dab) to head (25a385f).
⚠️ Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
...rc/gitops/components/shared/ApplicationSetList.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
+ Coverage   11.30%   12.76%   +1.46%     
==========================================
  Files         169      172       +3     
  Lines        6679     6839     +160     
  Branches     2235     2310      +75     
==========================================
+ Hits          755      873     +118     
+ Misses       5923     5725     -198     
- Partials        1      241     +240     
Flag Coverage Δ
unit-tests 12.76% <93.33%> (+1.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@keithchong
keithchong requested a review from aali309 September 2, 2026 14:21

@keithchong keithchong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The tests passed for me.

@aali309 aali309 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks Triona

@keithchong
keithchong merged commit 3ea06fd into redhat-developer:main Sep 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants