Skip to content

fix(portal-plugin-billing): fix test mocks for lazyIcon and createNamespacedId exports#1093

Merged
pcfreak30 merged 1 commit into
developfrom
fix/billing-test-mocks
Jul 7, 2026
Merged

fix(portal-plugin-billing): fix test mocks for lazyIcon and createNamespacedId exports#1093
pcfreak30 merged 1 commit into
developfrom
fix/billing-test-mocks

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Add lazyIcon mock to all test files that mock portal-framework-ui-core
  • Add createNamespacedId mock to portal-framework-core test mocks
  • Add resolve aliases to vitest.config.ts to fix Vite ESM barrel re-export issues in browser test mode
  • Fixes 10 test files that were failing due to missing named exports from large barrel files

This PR fixes test mocks in the portal-plugin-billing test suite by adding missing mock implementations for lazyIcon (from @lumeweb/portal-framework-ui-core) and createNamespacedId (from @lumeweb/portal-framework-core) across multiple component and hook test files. These exports were being used by components but not mocked, causing tests to fail.

Additionally, the vitest configuration is updated to include @lumeweb/portal-framework-ui-core in optimized dependencies and add path aliases for both @lumeweb/portal-framework-ui-core and @lumeweb/portal-framework-core packages. A test assertion in CheckoutSuccess.test.tsx is also corrected to look for the check-circle test ID instead of the outdated check-icon.

@kody-ai

This comment has been minimized.

…espacedId exports

- Add lazyIcon mock to all test files that mock portal-framework-ui-core
  (returns component with kebab-case data-testid matching icon name)
- Add createNamespacedId mock to tests that mock portal-framework-core
- Add Collapsible mock to PlanChangeDialog test
- Add resolve aliases for portal-framework-ui-core and portal-framework-core
  in vitest browser project config to fix Vite ESM barrel re-export resolution
- Fix CheckoutSuccess test to expect 'check-circle' test-id instead of 'check-icon'

Resolves 10 of 12 pre-existing test failures caused by Vite browser ESM
loader unable to resolve named re-exports from large barrel files.
@pcfreak30 pcfreak30 force-pushed the fix/billing-test-mocks branch from d7f85ca to 2fb56ab Compare July 7, 2026 03:35
@kody-ai

kody-ai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@pcfreak30 pcfreak30 merged commit 03888b8 into develop Jul 7, 2026
3 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.

1 participant