Skip to content

[Test Improver] Add unit tests for uiplugins.ts onExtensionsReady, getLatestExtensionVersion, installHelmChart - #18890

Merged
nwmac merged 1 commit into
masterfrom
test-assist/uiplugins-extra-tests-82ec8de4385ad18f
Aug 22, 2026
Merged

[Test Improver] Add unit tests for uiplugins.ts onExtensionsReady, getLatestExtensionVersion, installHelmChart#18890
nwmac merged 1 commit into
masterfrom
test-assist/uiplugins-extra-tests-82ec8de4385ad18f

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Test Improver, an AI assistant for improving test coverage.

Goal

Add unit tests for three previously untested exported functions in shell/utils/uiplugins.ts. These functions handle extension loading, Helm chart version lookup, and Helm chart installation — all part of the UI Plugin system critical path.

Approach

  • onExtensionsReady: Test early-return when already ready, dispatch of setReady on completion, sequential onLogIn calls per plugin, error resilience when a plugin's onLogIn throws, and graceful handling of a null plugins getter.
  • getLatestExtensionVersion: Test first-compatible-version selection (skipping incompatible), no-compatible-versions path, missing chart path, and custom dispatch options.
  • installHelmChart: Test default install action, upgrade action override, custom namespace, annotation content from chart metadata, and custom values passthrough.

All three functions are mocked cleanly with no real network/store I/O.

Coverage Impact

Metric Before After
Statements 34.23% 55.16%
Branches 100% 100%
Functions 15.38% 38.46%
Lines 34.23% 55.16%

(Remaining uncovered functions involve complex async polling loops with retries — waitForUIExtension, waitForUIPackage, createHelmRepository, getHelmChart, refreshHelmRepository, getHelmRepository* — which would require fake timers and intricate mock sequencing; left for a follow-up.)

Test Status

✅ 14/14 tests pass
✅ Lint clean (eslint --max-warnings 0)

Reproducibility

yarn test:ci shell/utils/__tests__/uiplugins-extra.test.ts
# or:
node_modules/.bin/jest --no-coverage shell/utils/__tests__/uiplugins-extra.test.ts

Fixes: N/A (new tests)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • download.cypress.io

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "download.cypress.io"

See Network Configuration for more information.

Generated by Daily Test Improver · sonnet46 234.1 AIC · ⌖ 7.37 AIC · ⊞ 12.8K ·
Comment /test-assist to run again

…sionVersion, installHelmChart

Add 14 new unit tests for three previously untested functions in
shell/utils/uiplugins.ts:

- onExtensionsReady: tests for early-return (already ready), dispatch
  setReady on completion, onLogIn called for each plugin, error
  resilience (onLogIn throws), and null plugins getter
- getLatestExtensionVersion: tests for first-compatible-version
  selection, no compatible versions, missing chart, and custom dispatch
  options
- installHelmChart: tests for default install action, upgrade action,
  custom namespace, annotation content, and custom values passthrough

Coverage: statements 34%→55%, branches 100% (no change), functions
15%→38%

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nwmac
nwmac marked this pull request as ready for review August 21, 2026 12:43
@nwmac
nwmac merged commit 17ad8a6 into master Aug 22, 2026
81 of 84 checks passed
@nwmac
nwmac deleted the test-assist/uiplugins-extra-tests-82ec8de4385ad18f branch August 22, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants