Skip to content

test(ui): drop organization unit tests restated by integration - #12382

Merged
pfe-nazaries merged 2 commits into
masterfrom
feature/azure-org-unit-cleanup
Aug 11, 2026
Merged

pfe-nazaries merged 2 commits into
masterfrom
feature/azure-org-unit-cleanup

Conversation

@pfe-nazaries

@pfe-nazaries pfe-nazaries commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Context

First batch of the UI testing policy the team has been converging on: minimum number of tests for maximum user-facing coverage. Every test deleted here is already restated, verbatim or near-verbatim, by a named integration test that drives the real providers page through the browser — so the unit test buys nothing but a second place to maintain the same assertion.

This is layer 1 of the Azure Management Group onboarding stack. It depends on nothing and touches no production code.

Description

Removed:

  • gcp-method-selector.test.tsx — the whole file. Both tests are restated by the GCP integration gating/entry tests.
  • org-launch-scan.test.tsx — the ADVANCED-path cases whose schedule/launch outcomes the AWS and GCP integration launch tests already assert. Deliberately kept: the loading state, the transport-failure path, and the DAILY_LEGACY / MANUAL_ONLY / BLOCKED describes, none of which have an integration twin.
  • use-org-setup-submission.test.ts — the happy path and the retry case. Deliberately kept: the fake-timer timeout/resume path and the error-routing matrix, which are internal enough to warrant a unit test.

aws-method-selector.test.tsx is explicitly not touched: AWS OSS gating has no integration counterpart.

Five further candidates were identified and left for a later batch rather than widening this PR.

Steps to review

  1. For each deleted test, confirm the named integration test that replaces it still exists and asserts the same thing.
  2. cd ui && pnpm exec vitest run --project unit — green.
  3. cd ui && pnpm exec vitest run --project integration — green, and unchanged by this PR.

Checklist

  • Are there new checks included in this PR? No
  • Review if the code is being covered by tests. — this PR only removes duplicated coverage; the behaviour stays covered by integration tests.
  • Review if code is being documented following the style guide. — no production code touched.
  • Review if backport is needed. — no.
  • Review if is needed to change the Readme.md — no.
  • Ensure a changelog fragment is added under <component>/changelog.d/, if applicable. — not applicable, test-only; PR labelled no-changelog.

UI

  • All issue/task requirements work as expected on the UI — no user-facing change.
  • Screenshots/Video — not applicable, no UI change.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Summary by CodeRabbit

  • Tests
    • Expanded coverage for organization setup recovery, including discovery timeouts, retries, resumed submissions, validation errors, and provider-specific failures.
    • Removed outdated checks for legacy organization upgrade and advanced scheduling scenarios.
    • Improved test stability by simplifying test setup and removing obsolete dependencies.

@pfe-nazaries
pfe-nazaries requested a review from a team August 7, 2026 07:03
@pfe-nazaries pfe-nazaries added the no-changelog Skip including change in changelog/release notes label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f4203460-a8af-4e6f-b95c-a2e882e81e76

📥 Commits

Reviewing files that changed from the base of the PR and between 25ac2b2 and c20b924.

📒 Files selected for processing (2)
  • ui/components/providers/organizations/gcp-method-selector.test.tsx
  • ui/components/providers/organizations/hooks/use-org-setup-submission.test.ts

📝 Walkthrough

Walkthrough

The pull request removes GCP organization selector tests, updates organization setup submission coverage for discovery recovery, and removes ADVANCED organization scan-launch tests for partial, failed, and empty bulk schedule responses.

Changes

Organization test coverage

Layer / File(s) Summary
Onboarding test updates
ui/components/providers/organizations/gcp-method-selector.test.tsx, ui/components/providers/organizations/hooks/use-org-setup-submission.test.ts
GCP method-selector coverage was removed. Organization setup tests no longer use the removed React wrapper and now cover shared setup-chain configuration and discovery timeout recovery.
Scan launch test updates
ui/components/providers/organizations/org-launch-scan.test.tsx
The unused userEvent import and tests for partial, failed, and empty bulk schedule responses were removed.

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

Possibly related PRs

Suggested reviewers: alan-thegentleman

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes removing organization unit tests duplicated by integration tests.
Description check ✅ Passed The description includes context, change details, review steps, checklist decisions, scope, and license confirmation.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/azure-org-unit-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

No Conflicts

No conflict markers, and the branch merges cleanly into its base.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🔒 Container Security Scan

Image: prowler-ui:7137460
Last scan: 2026-08-11 07:34:15 UTC

✅ No Vulnerabilities Detected

The container image passed all security checks. No known CVEs were found.

📋 Resources:

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🔎 Container Security Scan (Grype)

Image: prowler-ui:7137460
Last scan: 2026-08-11 07:35:31 UTC

✅ Nothing Blocking

No findings at critical or high severity.


📋 Resources:

@pfe-nazaries
pfe-nazaries marked this pull request as draft August 7, 2026 07:12
@pfe-nazaries
pfe-nazaries marked this pull request as ready for review August 7, 2026 08:03

@alejandrobailo alejandrobailo 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.

I found three coverage regressions in this test-only cleanup. The replacement integration tests do not fully restate the deleted behavior. Please restore equivalent assertions before removing these tests.

Comment thread ui/components/providers/organizations/gcp-method-selector.test.tsx
Comment thread ui/components/providers/organizations/org-launch-scan.test.tsx
- Delete the GCP method selector suite, covered by the GCP
  integration gating and entry tests
- Trim the launch-step schedule outcomes the AWS/GCP integration
  launch tests already assert
- Trim the setup-chain happy path and discovery retry from the
  submission hook suite
- Restore the discovery-retry case: the MSW handler answers every trigger
  with one static discovery, so integration can only count POSTs
- Restore the GCP OSS gating case: the cloud upgrade modal mounts outside
  the providers page, so the harness cannot see the upsell open
@pfe-nazaries

Copy link
Copy Markdown
Contributor Author

All three hold. Two are restored here (c20b924fe); the third is asserted in integration instead.

  • retry — restored. Worse than the fixture staying failed: the MSW handler answers every /discover POST with the same fixture id and /discoveries/:id returns a static status, so integration can only count POSTs.
  • GCP OSS gating — restored, OSS case only. CloudUpgradeModal mounts in main-layout, outside the providers page, so the harness cannot see the upsell open.
  • ACTIVE tab — asserted in test(ui): consolidate the providers page integration suites #12383 through the rendered toast link. org-launch-scan.tsx has two independent targetTab expressions; the retained MANUAL_ONLY → ACTIVE test covers only the legacy one, so the advanced arm had no coverage anywhere.

Coverage map for the remaining deletions — file › describe › it in #12383's consolidated ui/app/(prowler)/providers/providers-page.integration.test.tsx:

Deleted here Restated by
gcp-method-selector.test.tsx › enters the GCP org flow in Cloud Organization onboarding wizard › GCP Organizations › Full onboarding run › completes the happy path…
use-org-setup-submission.test.ts › completes the setup chain and stores selectable candidates … › AWS Organizations › Full onboarding run › completes the happy path…, plus Account selection › disables blocked accounts and excludes them from the selectable count
org-launch-scan.test.tsx › should launch the complete organization after a partial schedule save … › GCP Organizations › Launch and scheduling › launches the organization after a partial schedule save (now with the ACTIVE-tab assertion)
org-launch-scan.test.tsx › should treat a fully-failed bulk response as an error without navigating away … › Launch and scheduling › keeps the user on the launch step when no schedule could be saved
org-launch-scan.test.tsx › should describe partial failures in the success toast … › Launch and scheduling › launches the organization after a partial schedule save
org-launch-scan.test.tsx › should proceed when the response carries no result lists … › Launch and scheduling › proceeds when the schedule response carries no result lists

One note on framing: those integration tests are not new to #12383 — they are already on master in providers-page.gcp.integration.test.tsx. #12383 only moves them into the consolidated file.

@alejandrobailo
alejandrobailo self-requested a review August 11, 2026 08:18

@Alan-TheGentleman Alan-TheGentleman 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.

The prior clean review remains valid after the focused test-only updates. Approved.

@pfe-nazaries
pfe-nazaries merged commit 9316124 into master Aug 11, 2026
46 of 47 checks passed
@pfe-nazaries
pfe-nazaries deleted the feature/azure-org-unit-cleanup branch August 11, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ui no-changelog Skip including change in changelog/release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants