Skip to content

Enable frontend package unit tests in CI and fix broken tests#2802

Open
DonOmalVindula wants to merge 1 commit into
thunder-id:mainfrom
DonOmalVindula:fix/enable-frontend-package-tests-in-ci
Open

Enable frontend package unit tests in CI and fix broken tests#2802
DonOmalVindula wants to merge 1 commit into
thunder-id:mainfrom
DonOmalVindula:fix/enable-frontend-package-tests-in-ci

Conversation

@DonOmalVindula
Copy link
Copy Markdown
Contributor

@DonOmalVindula DonOmalVindula commented May 18, 2026

Purpose

After sharding was introduced to the test workflow, only Console and Gate app tests were executed during PRs. Tests for frontend package workspaces (frontend/packages/*) were silently skipped. This PR enables them in CI and fixes all broken tests that were hidden by the omission.

Approach

CI workflow (pr-builder.yml):

  • Add a "Run Package Tests" step on shard 1 that runs pnpm --filter './packages/*' test

Test-utils setup (test-utils/src/setup.ts):

  • Load all i18n namespaces (...enUS) instead of listing them individually. vi.mock('react-i18next') doesn't work in Vitest browser mode, so tests must use real translations — this ensures all namespaces resolve correctly.

Test fixes (36 files across 4 packages):

  • configure-translations (14 files): Remove non-functional vi.mock('react-i18next'), update assertions to use real English translations
  • configure-organization-units (14 files): Same pattern, plus fix clipboard mock (Object.defineProperty instead of Object.assign for read-only navigator.clipboard), fix getInitials import error, disambiguate duplicate text selectors
  • configure-users (5 files): Fix mock paths from relative (../../../organization-units/...) to package (@thunderid/configure-organization-units), fix async React import in mock factory, fix password label selector ambiguity
  • configure-agent-types (1 file): Update assertions to match real agentTypes namespace translations

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • Tests
    • Updated many test suites to match revised UI copy and accessible labels; removed local translation mocks so tests validate real localization. Improved clipboard-related test reliability and updated several interaction/assertion targets.
  • Chores
    • CI adjusted to run frontend package tests and updated coverage report handling to strip branch/coverage markers from LCOV outputs.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Enables package workspace tests in the PR CI shard, updates LCOV strip inputs; removes per-file react-i18next mocks across many frontend tests, updates DOM queries/visible-string assertions, retargets some module mocks to package exports, and simplifies test-utils i18n resource assembly.

Changes

Frontend test refactor and CI package activation

Layer / File(s) Summary
CI workflow: enable package tests & adjust LCOV strip
.github/workflows/pr-builder.yml
Shard 1 of test-frontend runs pnpm --filter './packages/*' test; LCOV branch-data stripping updated to omit BRDA/BRF/BRH from app LCOVs; minor whitespace boundary change.
Organization-units tests: remove react-i18next mocks & update assertions
frontend/packages/configure-organization-units/...
Many tests remove local react-i18next mocks and now assert user-visible headings, aria-labels, button labels, snackbar messages (including punctuation), and use improved DOM queries and clipboard mocking (Object.defineProperty).
Translations tests: remove i18n mocks & assert visible strings
frontend/packages/configure-translations/...
Translation pages/components remove react-i18next mocks; tests now verify concrete English labels/placeholders/helper text/toasts and use role/accessible-name queries for actions like Edit/Delete and Add Key flows.
Users & agent-types tests: retarget mocks, remove i18n mocks, adjust DOM selection
frontend/packages/configure-users/..., frontend/packages/configure-agent-types/...
Mocks retargeted to @thunderid/configure-organization-units, React default import used in mock factories, password input selection improved, and agent-types test locators updated.
Test utils: i18n resource assembly simplified
frontend/packages/test-utils/src/setup.ts
Test i18n resources for en-US now spread the enUS bundle (...enUS) instead of enumerating top-level keys.
Apps tests small updates
frontend/apps/console/...
DecoratedVisualFlow and RolesList tests switched to role/name queries for Save button and failure headings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jeradrutnam
  • brionmario
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: enabling frontend package tests in CI and fixing broken tests that were previously hidden.
Description check ✅ Passed The description is comprehensive and follows the template structure with Purpose, Approach, Related Issues, Related PRs, Checklist, and Security checks sections filled out.
Linked Issues check ✅ Passed The PR successfully addresses the linked issue #2694 by re-enabling frontend package tests in CI via the new 'Run Package Tests' step and fixing all broken tests across 36 files in 4 packages.
Out of Scope Changes check ✅ Passed All changes are in-scope with the PR objectives: CI workflow updates for package tests, test-utils i18n setup fix, and 36 test file fixes directly addressing broken tests. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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/configure-translations/src/components/edit-translation/__tests__/TranslationEditorHeader.test.tsx`:
- Line 92: The test assertion is checking the wrong plural form ("3 unsaved
change"); update the expectation in TranslationEditorHeader.test.tsx to assert
the pluralized text ("3 unsaved changes") and, if the component
TranslationEditorHeader uses i18n keys, ensure the i18n key or pluralization
helper used by TranslationEditorHeader (or its getUnsavedCountLabel helper) is
plural-aware so counts >1 render "unsaved changes" rather than the singular
form.

In
`@frontend/packages/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx`:
- Around line 314-315: The test in TranslationsEditPage.test.tsx asserts the
save toast synchronously using screen.getByText('All translations saved.'),
which can be flaky because the toast appears after async mutation; change this
to use the async query: await screen.findByText('All translations saved.') and
then assert (e.g., const toast = await screen.findByText(...);
expect(toast).toBeInTheDocument()), replacing the synchronous screen.getByText
call so the test waits for the toast to appear.

In
`@frontend/packages/configure-users/src/pages/__tests__/UserInvitePage.test.tsx`:
- Around line 384-385: The tests in UserInvitePage.test.tsx use brittle
selectors (document.getElementById and getAllByDisplayValue('')) to target
password inputs; update those assertions to use accessible label-based queries
instead (e.g., screen.getByLabelText or screen.getAllByLabelText with the
visible FormLabel text for the password fields) so they rely on the associated
htmlFor labels rendered by PASSWORD_INPUT; replace occurrences around the shown
lines (and the other instances at 397-399 and 766-770) to assert presence/value
using the label queries and avoid direct id/value-based DOM lookups.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ae526d75-e234-4e3a-828e-084e8593bd36

📥 Commits

Reviewing files that changed from the base of the PR and between 2cc6754 and 8c2c6fb.

📒 Files selected for processing (36)
  • .github/workflows/pr-builder.yml
  • frontend/packages/configure-agent-types/src/components/edit-agent-type/schema-settings/__tests__/EditSchemaSettings.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitTreePicker.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitsTreeView.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/child-organization-unit-settings/__tests__/ManageChildOrganizationUnitSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/customization-settings/__tests__/AppearanceSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/DangerZoneSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/EditGeneralSettings.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/ParentSettingsSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/QuickCopySection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/group-settings/__tests__/ManageGroupsSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/user-settings/__tests__/ManageUsersSection.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/CreateOrganizationUnitPage.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/OrganizationUnitEditPage.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/OrganizationUnitsListPage.test.tsx
  • frontend/packages/configure-translations/src/components/__tests__/TranslationDeleteDialog.test.tsx
  • frontend/packages/configure-translations/src/components/__tests__/TranslationsList.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/InitializeLanguage.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/ReviewLocaleCode.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/SelectCountry.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/SelectLanguage.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/NamespaceSelector.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationEditorCard.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationEditorHeader.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationFieldsView.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationJsonEditor.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationCreatePage.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationsListPage.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureOrganizationUnit.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureUserDetails.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureUserType.test.tsx
  • frontend/packages/configure-users/src/pages/__tests__/UserCreatePage.test.tsx
  • frontend/packages/configure-users/src/pages/__tests__/UserInvitePage.test.tsx
  • frontend/packages/test-utils/src/setup.ts
💤 Files with no reviewable changes (2)
  • frontend/packages/configure-organization-units/src/components/tests/OrganizationUnitDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/components/tests/OrganizationUnitTreePicker.test.tsx

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.github/workflows/pr-builder.yml:
- Around line 372-375: The merge step "🔀 Merge package coverage reports"
currently masks failures with "|| true" and the artifact upload uses
"if-no-files-found: warn", so adjust both to fail fast: remove "|| true" from
the find command in the "🔀 Merge package coverage reports" step so the step
exits non‑zero when no lcov.info files are found, and change the artifact upload
step’s if-no-files-found behavior from "warn" to "error" (or remove that option)
so the job fails when the merged coverage file is missing or empty; keep the
matrix.shard gating as-is.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c6842ff-a890-4b88-a1fd-1df168cb46b0

📥 Commits

Reviewing files that changed from the base of the PR and between 8c2c6fb and a51a87c.

📒 Files selected for processing (1)
  • .github/workflows/pr-builder.yml

Comment thread .github/workflows/pr-builder.yml
@DonOmalVindula DonOmalVindula force-pushed the fix/enable-frontend-package-tests-in-ci branch 2 times, most recently from 8ac81e7 to a39f85d Compare May 19, 2026 05:58
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
frontend/packages/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx (2)

314-314: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use async query for toast assertions after async save operations.

After clicking save, the toast is rendered asynchronously following the completion of mutation requests. Using synchronous getByText() creates timing flakiness.

🔄 Suggested fix
-      expect(screen.getByText('All translations saved.')).toBeInTheDocument();
+      expect(await screen.findByText('All translations saved.')).toBeInTheDocument();
🤖 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/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx`
at line 314, The assertion expecting the toast uses a synchronous query
(screen.getByText('All translations saved.')) which is flaky because the toast
appears after async mutation; replace that assertion with an async query such as
await screen.findByText('All translations saved.') or wrap the assertion in a
waitFor call to wait for the toast after the save click in
TranslationsEditPage.test.tsx so the test waits for the async save to complete
before asserting. Ensure you update the expectation that currently uses
screen.getByText(...) to use the async query and keep the same assertion
(.toBeInTheDocument()).

335-335: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use async query for error toast assertion.

The error toast also appears asynchronously after the failed save operation completes.

🔄 Suggested fix
-      expect(screen.getByText('Failed to save some translations.')).toBeInTheDocument();
+      expect(await screen.findByText('Failed to save some translations.')).toBeInTheDocument();
🤖 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/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx`
at line 335, The test is asserting an error toast synchronously using getByText
which can miss an asynchronously-rendered toast; update the assertion in
TranslationsEditPage.test (replace expect(screen.getByText('Failed to save some
translations.')).toBeInTheDocument()) to use an async query such as await
screen.findByText('Failed to save some translations.') (and then assert
truthiness or toBeInTheDocument()), or wrap the assertion in await waitFor(() =>
expect(screen.getByText(...)).toBeInTheDocument()) so the test waits for the
toast to appear after the failed save.
🤖 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.

Duplicate comments:
In
`@frontend/packages/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx`:
- Line 314: The assertion expecting the toast uses a synchronous query
(screen.getByText('All translations saved.')) which is flaky because the toast
appears after async mutation; replace that assertion with an async query such as
await screen.findByText('All translations saved.') or wrap the assertion in a
waitFor call to wait for the toast after the save click in
TranslationsEditPage.test.tsx so the test waits for the async save to complete
before asserting. Ensure you update the expectation that currently uses
screen.getByText(...) to use the async query and keep the same assertion
(.toBeInTheDocument()).
- Line 335: The test is asserting an error toast synchronously using getByText
which can miss an asynchronously-rendered toast; update the assertion in
TranslationsEditPage.test (replace expect(screen.getByText('Failed to save some
translations.')).toBeInTheDocument()) to use an async query such as await
screen.findByText('Failed to save some translations.') (and then assert
truthiness or toBeInTheDocument()), or wrap the assertion in await waitFor(() =>
expect(screen.getByText(...)).toBeInTheDocument()) so the test waits for the
toast to appear after the failed save.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e6d34ded-d30b-4123-ada6-7363eff55dcd

📥 Commits

Reviewing files that changed from the base of the PR and between 8ac81e7 and a39f85d.

📒 Files selected for processing (38)
  • .github/workflows/pr-builder.yml
  • frontend/apps/console/src/features/flows/components/visual-flow/__tests__/DecoratedVisualFlow.test.tsx
  • frontend/apps/console/src/features/roles/components/__tests__/RolesList.test.tsx
  • frontend/packages/configure-agent-types/src/components/edit-agent-type/schema-settings/__tests__/EditSchemaSettings.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitTreePicker.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitsTreeView.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/child-organization-unit-settings/__tests__/ManageChildOrganizationUnitSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/customization-settings/__tests__/AppearanceSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/DangerZoneSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/EditGeneralSettings.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/ParentSettingsSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/QuickCopySection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/group-settings/__tests__/ManageGroupsSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/user-settings/__tests__/ManageUsersSection.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/CreateOrganizationUnitPage.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/OrganizationUnitEditPage.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/OrganizationUnitsListPage.test.tsx
  • frontend/packages/configure-translations/src/components/__tests__/TranslationDeleteDialog.test.tsx
  • frontend/packages/configure-translations/src/components/__tests__/TranslationsList.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/InitializeLanguage.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/ReviewLocaleCode.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/SelectCountry.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/SelectLanguage.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/NamespaceSelector.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationEditorCard.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationEditorHeader.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationFieldsView.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationJsonEditor.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationCreatePage.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationsListPage.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureOrganizationUnit.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureUserDetails.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureUserType.test.tsx
  • frontend/packages/configure-users/src/pages/__tests__/UserCreatePage.test.tsx
  • frontend/packages/configure-users/src/pages/__tests__/UserInvitePage.test.tsx
  • frontend/packages/test-utils/src/setup.ts
💤 Files with no reviewable changes (2)
  • frontend/packages/configure-organization-units/src/components/tests/OrganizationUnitDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/components/tests/OrganizationUnitTreePicker.test.tsx
✅ Files skipped from review due to trivial changes (2)
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/customization-settings/tests/AppearanceSection.test.tsx
  • frontend/packages/configure-agent-types/src/components/edit-agent-type/schema-settings/tests/EditSchemaSettings.test.tsx
🚧 Files skipped from review as they are similar to previous changes (31)
  • frontend/packages/configure-organization-units/src/pages/tests/OrganizationUnitsListPage.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/DangerZoneSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/child-organization-unit-settings/tests/ManageChildOrganizationUnitSection.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/tests/SelectLanguage.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/QuickCopySection.test.tsx
  • frontend/apps/console/src/features/flows/components/visual-flow/tests/DecoratedVisualFlow.test.tsx
  • frontend/packages/configure-users/src/components/create-user/tests/ConfigureOrganizationUnit.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/NamespaceSelector.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/TranslationJsonEditor.test.tsx
  • frontend/packages/test-utils/src/setup.ts
  • frontend/packages/configure-translations/src/components/tests/TranslationsList.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/TranslationEditorHeader.test.tsx
  • frontend/packages/configure-translations/src/pages/tests/TranslationsListPage.test.tsx
  • frontend/packages/configure-users/src/components/create-user/tests/ConfigureUserDetails.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/EditGeneralSettings.test.tsx
  • frontend/packages/configure-users/src/pages/tests/UserCreatePage.test.tsx
  • frontend/packages/configure-users/src/pages/tests/UserInvitePage.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/TranslationFieldsView.test.tsx
  • frontend/packages/configure-organization-units/src/pages/tests/CreateOrganizationUnitPage.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/tests/InitializeLanguage.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/ParentSettingsSection.test.tsx
  • frontend/packages/configure-users/src/components/create-user/tests/ConfigureUserType.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/user-settings/tests/ManageUsersSection.test.tsx
  • frontend/packages/configure-translations/src/components/tests/TranslationDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/group-settings/tests/ManageGroupsSection.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/TranslationEditorCard.test.tsx
  • .github/workflows/pr-builder.yml
  • frontend/packages/configure-organization-units/src/pages/tests/OrganizationUnitEditPage.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/tests/ReviewLocaleCode.test.tsx
  • frontend/packages/configure-organization-units/src/components/tests/OrganizationUnitsTreeView.test.tsx
  • frontend/packages/configure-translations/src/pages/tests/TranslationCreatePage.test.tsx

@DonOmalVindula DonOmalVindula force-pushed the fix/enable-frontend-package-tests-in-ci branch from a39f85d to 653a08a Compare May 19, 2026 06:26
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.github/workflows/pr-builder.yml:
- Around line 366-370: The package vitest configs (e.g.,
frontend/packages/components/vitest.config.ts) don’t enable coverage while the
app config (frontend/apps/console/vite.config.ts) does; add coverage
configuration to each package vitest config by updating the exported
defineConfig to include test.coverage with provider: "istanbul" and reporters
including "lcov" (and optional "text"), or adjust package.json test scripts to
invoke vitest with --coverage, so that running pnpm --filter './packages/*' test
collects and emits LCOV coverage consistent with the PR objective.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 423045b1-270a-4f22-965f-9052008e06ff

📥 Commits

Reviewing files that changed from the base of the PR and between a39f85d and 653a08a.

📒 Files selected for processing (38)
  • .github/workflows/pr-builder.yml
  • frontend/apps/console/src/features/flows/components/visual-flow/__tests__/DecoratedVisualFlow.test.tsx
  • frontend/apps/console/src/features/roles/components/__tests__/RolesList.test.tsx
  • frontend/packages/configure-agent-types/src/components/edit-agent-type/schema-settings/__tests__/EditSchemaSettings.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitTreePicker.test.tsx
  • frontend/packages/configure-organization-units/src/components/__tests__/OrganizationUnitsTreeView.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/child-organization-unit-settings/__tests__/ManageChildOrganizationUnitSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/customization-settings/__tests__/AppearanceSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/DangerZoneSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/EditGeneralSettings.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/ParentSettingsSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/__tests__/QuickCopySection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/group-settings/__tests__/ManageGroupsSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/user-settings/__tests__/ManageUsersSection.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/CreateOrganizationUnitPage.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/OrganizationUnitEditPage.test.tsx
  • frontend/packages/configure-organization-units/src/pages/__tests__/OrganizationUnitsListPage.test.tsx
  • frontend/packages/configure-translations/src/components/__tests__/TranslationDeleteDialog.test.tsx
  • frontend/packages/configure-translations/src/components/__tests__/TranslationsList.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/InitializeLanguage.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/ReviewLocaleCode.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/SelectCountry.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/__tests__/SelectLanguage.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/NamespaceSelector.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationEditorCard.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationEditorHeader.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationFieldsView.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/__tests__/TranslationJsonEditor.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationCreatePage.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationsEditPage.test.tsx
  • frontend/packages/configure-translations/src/pages/__tests__/TranslationsListPage.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureOrganizationUnit.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureUserDetails.test.tsx
  • frontend/packages/configure-users/src/components/create-user/__tests__/ConfigureUserType.test.tsx
  • frontend/packages/configure-users/src/pages/__tests__/UserCreatePage.test.tsx
  • frontend/packages/configure-users/src/pages/__tests__/UserInvitePage.test.tsx
  • frontend/packages/test-utils/src/setup.ts
💤 Files with no reviewable changes (2)
  • frontend/packages/configure-organization-units/src/components/tests/OrganizationUnitDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/components/tests/OrganizationUnitTreePicker.test.tsx
✅ Files skipped from review due to trivial changes (1)
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/EditGeneralSettings.test.tsx
🚧 Files skipped from review as they are similar to previous changes (25)
  • frontend/apps/console/src/features/roles/components/tests/RolesList.test.tsx
  • frontend/packages/configure-agent-types/src/components/edit-agent-type/schema-settings/tests/EditSchemaSettings.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/child-organization-unit-settings/tests/ManageChildOrganizationUnitSection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/user-settings/tests/ManageUsersSection.test.tsx
  • frontend/packages/configure-users/src/components/create-user/tests/ConfigureUserDetails.test.tsx
  • frontend/apps/console/src/features/flows/components/visual-flow/tests/DecoratedVisualFlow.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/tests/SelectCountry.test.tsx
  • frontend/packages/configure-organization-units/src/pages/tests/CreateOrganizationUnitPage.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/customization-settings/tests/AppearanceSection.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/NamespaceSelector.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/group-settings/tests/ManageGroupsSection.test.tsx
  • frontend/packages/configure-users/src/pages/tests/UserCreatePage.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/DangerZoneSection.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/tests/SelectLanguage.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/TranslationEditorCard.test.tsx
  • frontend/packages/test-utils/src/setup.ts
  • frontend/packages/configure-organization-units/src/pages/tests/OrganizationUnitsListPage.test.tsx
  • frontend/packages/configure-translations/src/components/edit-translation/tests/TranslationJsonEditor.test.tsx
  • frontend/packages/configure-translations/src/components/create-translation/tests/ReviewLocaleCode.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/QuickCopySection.test.tsx
  • frontend/packages/configure-organization-units/src/components/edit-organization-unit/general-settings/tests/ParentSettingsSection.test.tsx
  • frontend/packages/configure-users/src/pages/tests/UserInvitePage.test.tsx
  • frontend/packages/configure-translations/src/components/tests/TranslationDeleteDialog.test.tsx
  • frontend/packages/configure-organization-units/src/pages/tests/OrganizationUnitEditPage.test.tsx
  • frontend/packages/configure-translations/src/pages/tests/TranslationCreatePage.test.tsx

Comment thread .github/workflows/pr-builder.yml Outdated
@DonOmalVindula DonOmalVindula force-pushed the fix/enable-frontend-package-tests-in-ci branch 2 times, most recently from 868170c to d8fedcf Compare May 19, 2026 16:57
Add a CI step to run frontend package workspace tests with coverage
during PR builds. Previously, only Console and Gate app tests ran
after sharding was introduced — package tests were silently skipped.

Fix broken tests across configure-translations, configure-organization-units,
configure-users, configure-agent-types, and console caused by
vi.mock('react-i18next') not working in Vitest browser mode. Remove
non-functional mocks and update assertions to use real English translations.
Load all i18n namespaces in the test-utils setup for consistent behavior.

Add Istanbul coverage configuration to all 16 package vitest configs and
collect merged LCOV reports uploaded to Codecov under the
frontend-packages-unit flag.

Also fix clipboard mock incompatibility with browser mode, relative mock
paths that don't intercept package imports, and a missing handleInputChange
call in the PASSWORD_INPUT field handler.

Fixes thunder-id#2694
@DonOmalVindula DonOmalVindula force-pushed the fix/enable-frontend-package-tests-in-ci branch from d8fedcf to fabca93 Compare May 19, 2026 17:14
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.

[CI] Skips frontend package unit tests during PRs after sharding

1 participant