Skip to content

Add RTL unit tests for 9 critical Helm plugin components - #16909

Draft
sowmya-sl wants to merge 1 commit into
openshift:mainfrom
sowmya-sl:add-rtl-tests
Draft

Add RTL unit tests for 9 critical Helm plugin components#16909
sowmya-sl wants to merge 1 commit into
openshift:mainfrom
sowmya-sl:add-rtl-tests

Conversation

@sowmya-sl

@sowmya-sl sowmya-sl commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Adds React Testing Library tests covering user-facing behavior for HelmInstallUpgradeForm, HelmReleaseList, HelmReleaseRollbackForm, HelmTabbedPage, HelmURLChartForm, CreateHelmChartRepositoryForm, HelmChartVersionDropdown, HelmReleaseHistory, and RepositoriesList (79 new tests total) as part of the Helm testing SDLC Goal 3.

Analysis / Root cause:

Solution description:

Screenshots / screen recording:

Test setup:

Test cases:

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Reviewers and assignees:

Summary by CodeRabbit

  • Tests
    • Added broad test coverage across Helm release history, chart repositories, install/upgrade, rollback, URL chart forms, release lists, tabbed navigation, and repository lists.
    • Verified loading, error, empty, and success states, plus form behavior, button states, version selection, access-based navigation, and data rendering.
    • Improved confidence in Helm UI workflows and reduced risk of regressions.

Adds React Testing Library tests covering user-facing behavior for
HelmInstallUpgradeForm, HelmReleaseList, HelmReleaseRollbackForm,
HelmTabbedPage, HelmURLChartForm, CreateHelmChartRepositoryForm,
HelmChartVersionDropdown, HelmReleaseHistory, and RepositoriesList
(79 new tests total) as part of the Helm testing SDLC Goal 3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2026
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the component/helm Related to helm-plugin label Aug 5, 2026
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sowmya-sl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Added comprehensive unit test coverage for Helm plugin list pages, release history, repository creation, installation and upgrade, rollback, and URL-based chart forms. Tests mock component dependencies and verify rendering, loading, errors, state, navigation, and form behavior.

Changes

Helm plugin component tests

Layer / File(s) Summary
List and navigation tests
frontend/packages/helm-plugin/src/components/list-page/__tests__/*
Tests cover tab selection, access behavior, telemetry, menu actions, release list states, and repository list prop forwarding.
History and rollback tests
frontend/packages/helm-plugin/src/components/details-page/history/__tests__/HelmReleaseHistory.spec.tsx, frontend/packages/helm-plugin/src/components/forms/rollback/__tests__/HelmReleaseRollbackForm.spec.tsx
Tests cover release history loading, errors, revision propagation, rollback content, button states, cancellation, and submission errors.
Repository and URL form tests
frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/__tests__/CreateHelmChartRepositoryForm.spec.tsx, frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx
Tests cover repository create/edit states, YAML editor integration, URL chart fields, authentication controls, button states, and errors.
Install and upgrade form tests
frontend/packages/helm-plugin/src/components/forms/install-upgrade/__tests__/*
Tests cover chart version loading, namespace-specific requests, chart configuration, README visibility, submission states, errors, and authentication secret selection.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 11

❌ Failed checks (1 warning, 10 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a summary but leaves nearly all required template sections empty, including analysis, solution, test cases, and browser conformance. Complete the required sections with analysis, solution details, test setup, test cases, browser results, and reviewer or assignee information.
Stable And Deterministic Test Names ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Test Structure And Quality ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Microshift Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Single Node Openshift (Sno) Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Topology-Aware Scheduling Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ote Binary Stdout Contract ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Ipv6 And Disconnected Network Test Compatibility ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Weak-Crypto ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Container-Privileges ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
No-Sensitive-Data-In-Logs ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the addition of RTL tests for nine Helm plugin components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
frontend/packages/helm-plugin/src/components/forms/rollback/__tests__/HelmReleaseRollbackForm.spec.tsx (1)

29-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise the Cancel action.

This test only verifies that the mock renders a Cancel button. It does not verify cancellation behavior. Connect the Cancel button in the FormFooter mock to its cancellation callback, click it, and assert the expected reset or navigation action.

Also applies to: 216-220

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/helm-plugin/src/components/forms/rollback/__tests__/HelmReleaseRollbackForm.spec.tsx`
around lines 29 - 39, Update the FormFooter mock and rollback form test to
expose and invoke the cancellation callback from the Cancel button, then click
that button and assert the expected reset or navigation action. Preserve the
existing submit and error-message assertions while covering the cancellation
behavior through the relevant rollback form handler.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx`:
- Line 140: Update the component text and related assertions to capitalize
“Chart” whenever it immediately follows “Helm”: change the expected URL-chart
heading in
frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx
at lines 140-140 to “Install Helm Chart from URL”, and update the repository
description assertion in
frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/__tests__/CreateHelmChartRepositoryForm.spec.tsx
at lines 202-202 to use “Helm Chart”.

---

Nitpick comments:
In
`@frontend/packages/helm-plugin/src/components/forms/rollback/__tests__/HelmReleaseRollbackForm.spec.tsx`:
- Around line 29-39: Update the FormFooter mock and rollback form test to expose
and invoke the cancellation callback from the Cancel button, then click that
button and assert the expected reset or navigation action. Preserve the existing
submit and error-message assertions while covering the cancellation behavior
through the relevant rollback form handler.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 62fb0269-2e36-48d3-a245-34059f92f027

📥 Commits

Reviewing files that changed from the base of the PR and between e5715aa and c27c29a.

📒 Files selected for processing (9)
  • frontend/packages/helm-plugin/src/components/details-page/history/__tests__/HelmReleaseHistory.spec.tsx
  • frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/__tests__/CreateHelmChartRepositoryForm.spec.tsx
  • frontend/packages/helm-plugin/src/components/forms/install-upgrade/__tests__/HelmChartVersionDropdown.spec.tsx
  • frontend/packages/helm-plugin/src/components/forms/install-upgrade/__tests__/HelmInstallUpgradeForm.spec.tsx
  • frontend/packages/helm-plugin/src/components/forms/rollback/__tests__/HelmReleaseRollbackForm.spec.tsx
  • frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx
  • frontend/packages/helm-plugin/src/components/list-page/__tests__/HelmReleaseList.spec.tsx
  • frontend/packages/helm-plugin/src/components/list-page/__tests__/HelmTabbedPage.spec.tsx
  • frontend/packages/helm-plugin/src/components/list-page/__tests__/RepositoriesList.spec.tsx

it('should render the form title and description', () => {
renderWithProviders(<HelmURLChartForm {...defaultProps} />);

expect(screen.getByText('Install Helm chart from URL')).toBeVisible();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use Helm Chart in both expected UI strings.

Update the component text and these assertions together.

  • frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx#L140-L140: expect Install Helm Chart from URL.
  • frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/__tests__/CreateHelmChartRepositoryForm.spec.tsx#L202-L202: use Helm Chart in the repository description.

Based on learnings, capitalize “Chart” when it immediately follows “Helm”.

📍 Affects 2 files
  • frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx#L140-L140 (this comment)
  • frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/__tests__/CreateHelmChartRepositoryForm.spec.tsx#L202-L202
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx`
at line 140, Update the component text and related assertions to capitalize
“Chart” whenever it immediately follows “Helm”: change the expected URL-chart
heading in
frontend/packages/helm-plugin/src/components/forms/url-chart/__tests__/HelmURLChartForm.spec.tsx
at lines 140-140 to “Install Helm Chart from URL”, and update the repository
description assertion in
frontend/packages/helm-plugin/src/components/forms/HelmChartRepository/__tests__/CreateHelmChartRepositoryForm.spec.tsx
at lines 202-202 to use “Helm Chart”.

Source: Learnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/helm Related to helm-plugin do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant