Skip to content

feat(admin-ui): add test cases for all remaining uncovered files (#2915)#2916

Merged
duttarnab merged 3 commits into
mainfrom
admin-ui-issue-2915
Jul 2, 2026
Merged

feat(admin-ui): add test cases for all remaining uncovered files (#2915)#2916
duttarnab merged 3 commits into
mainfrom
admin-ui-issue-2915

Conversation

@faisalsiddique4400

@faisalsiddique4400 faisalsiddique4400 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

feat(admin-ui): add test cases for all remaining uncovered files (#2915)

Summary

This PR completes the remaining test coverage effort by adding test cases for files that were missed during previous iterations and standardizing the test folder structure across the Admin UI.

The goal is to maximize Jest coverage, improve consistency across the codebase, and establish a uniform organization for test files to simplify maintenance and future development.


Fix Summary

  • Added test cases for all remaining uncovered files identified during previous testing iterations
  • Increased overall Jest coverage across core, shared, and plugin modules
  • Standardized the test folder structure throughout the application
  • Reorganized test files to follow a consistent project-wide layout
  • Improved discoverability and maintainability of test suites
  • Added coverage for previously missed utilities, components, hooks, services, and other application modules where applicable
  • Aligned all new tests with existing Jest testing patterns and project standards

Verification

npm run test:all
npm run check:all

passes successfully.

  • Verified all newly added test cases execute successfully
  • Verified standardized test folder structure across the project
  • Verified existing test suites remain unaffected
  • Verified lint and type-check pass successfully
  • Verified no regressions introduced by the additional test coverage

🔗 Ticket

Closes: #2915

Summary by CodeRabbit

  • Tests
    • Added broad automated coverage across admin UI layouts, theming, routing, API handling, and configuration forms.
    • Expanded validation checks for auth server, SAML, FIDO, scripts, and user management flows.
    • Improved checks for error handling, field changes, default values, and payload formatting to help keep future updates stable.

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@faisalsiddique4400, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5efb8fe6-697a-4a6f-a339-da4df8586bd1

📥 Commits

Reviewing files that changed from the base of the PR and between 3bc1255 and cee94f5.

📒 Files selected for processing (5)
  • admin-ui/app/constants/__tests__/ui.test.ts
  • admin-ui/app/layout/__tests__/default.test.tsx
  • admin-ui/plugins/auth-server/api/__tests__/jsonPropertiesClient.test.ts
  • admin-ui/plugins/auth-server/components/Authentication/BuiltIn/__tests__/BuiltIn.test.tsx
  • admin-ui/plugins/services/__tests__/helper/utils.test.ts
📝 Walkthrough

Walkthrough

The PR adds Jest/RTL test coverage across admin UI shell components, shared utilities, auth-server helpers, and plugin-specific transformers and validators. It also covers axios instance behavior, audit logging helpers, and webhook-triggering utilities.

Changes

Admin UI shell and shared utilities

Layer / File(s) Summary
App, layout, and theme coverage
admin-ui/app/components/App/__tests__/AppMain.test.tsx, admin-ui/app/components/Layout/__tests__/*, admin-ui/app/components/Theme/__tests__/*
Tests cover router/error-boundary composition, layout part rendering, page config injection, and theme provider/class behavior.
Shared utility coverage
admin-ui/app/routes/Dashboards/Chart/__tests__/utils.test.ts, admin-ui/app/utils/__tests__/ApiResources.test.ts, admin-ui/orval/__tests__/axiosInstance.test.ts
Tests cover tooltip formatting, API resource constants, and axios base URL, token, and request/cancel behavior.

Auth server helper tests

Layer / File(s) Summary
Configuration and validation schemas
admin-ui/plugins/auth-server/components/AuthServerProperties/Properties/utils/__tests__/validations.test.ts, admin-ui/plugins/auth-server/components/Authentication/Acrs/helper/__tests__/validations.test.ts, admin-ui/plugins/auth-server/components/ConfigApiProperties/utils/__tests__/validations.test.ts, admin-ui/plugins/auth-server/components/Logging/__tests__/*
Tests cover app configuration, ACR, config API, and logging validation schemas.
Helper utilities and payload builders
admin-ui/plugins/auth-server/components/Authentication/AgamaFlows/__tests__/helper/utils.test.ts, admin-ui/plugins/auth-server/components/Ssa/__tests__/helper/*, admin-ui/plugins/auth-server/components/Ssa/utils/__tests__/formValidationUtils.test.ts
Tests cover Agama flow mapping helpers, SSA audit helpers, and SSA form validation utilities.

Plugin helper tests

Layer / File(s) Summary
FIDO and SAML transformers
admin-ui/plugins/fido/__tests__/helper/utils.test.ts, admin-ui/plugins/saml/__tests__/utils.test.ts
Tests cover FIDO and SAML form transforms, payload builders, field splitting, and optional-field cleaning.
FIDO, SAML, and script validations
admin-ui/plugins/saml/__tests__/validations.test.ts, admin-ui/plugins/scripts/components/helper/__tests__/*
Tests cover SAML validation schemas and script helper utilities, including script validation and field-change operations.

User management helper tests

Layer / File(s) Summary
Audit and webhook helpers
admin-ui/plugins/user-management/__tests__/helper/utils.test.ts
Tests cover user audit logging, error-message delegation, and webhook triggering.

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

Possibly related PRs

Suggested reviewers: duttarnab, moabu

Poem

🐰 I hopped through tests both wide and neat,
The layout, themes, and routes all meet.
From tokens, forms, and audit trails,
To helpers, schemas, logs, and scales —
This bunny says: “The coverage is sweet!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: adding test cases for uncovered admin-ui files.
Linked Issues check ✅ Passed The PR adds tests across uncovered admin-ui components, hooks, utilities, and plugins, matching issue #2915’s coverage goal.
Out of Scope Changes check ✅ Passed The changes stay within scope by adding only test files and no unrelated feature or refactor work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch admin-ui-issue-2915

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.

@mo-auto mo-auto added comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Jul 2, 2026
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>

@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: 2

🤖 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
`@admin-ui/plugins/auth-server/components/AuthServerProperties/Properties/utils/__tests__/validations.test.ts`:
- Around line 46-51: The test in createAppConfigurationSchema should verify the
coercion result, not just validity: update the empty-string number field case in
the validations test to assert that accessTokenLifetime is transformed to
null/absent after passing through the schema. Use createAppConfigurationSchema
with a cast/validate path and inspect the returned value so the test exercises
the actual transform instead of only isValid.

In `@admin-ui/plugins/user-management/__tests__/helper/utils.test.ts`:
- Around line 33-34: The logger mock in utils.test.ts is dropping the second
argument, so the failure-path assertions never verify the error value passed by
logUserCreation. Update the jest.mock for `@/utils/logger` so logger.error
forwards both the message and error arguments into mockLoggerError, then adjust
the relevant assertions in the test case that exercises logUserCreation to check
the full call signature, including the Error/String value.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 981de006-74d6-482f-9082-bb878354ccd1

📥 Commits

Reviewing files that changed from the base of the PR and between 2acf434 and 3bc1255.

📒 Files selected for processing (25)
  • admin-ui/app/components/App/__tests__/AppMain.test.tsx
  • admin-ui/app/components/Layout/__tests__/Layout.test.tsx
  • admin-ui/app/components/Layout/__tests__/LayoutContent.test.tsx
  • admin-ui/app/components/Layout/__tests__/LayoutSidebar.test.tsx
  • admin-ui/app/components/Layout/__tests__/withPageConfig.test.tsx
  • admin-ui/app/components/Theme/__tests__/ThemeClass.test.tsx
  • admin-ui/app/components/Theme/__tests__/ThemeProvider.test.tsx
  • admin-ui/app/routes/Dashboards/Chart/__tests__/utils.test.ts
  • admin-ui/app/utils/__tests__/ApiResources.test.ts
  • admin-ui/orval/__tests__/axiosInstance.test.ts
  • admin-ui/plugins/auth-server/components/AuthServerProperties/Properties/utils/__tests__/validations.test.ts
  • admin-ui/plugins/auth-server/components/Authentication/Acrs/helper/__tests__/validations.test.ts
  • admin-ui/plugins/auth-server/components/Authentication/AgamaFlows/__tests__/helper/utils.test.ts
  • admin-ui/plugins/auth-server/components/ConfigApiProperties/utils/__tests__/validations.test.ts
  • admin-ui/plugins/auth-server/components/Logging/__tests__/utils.test.ts
  • admin-ui/plugins/auth-server/components/Logging/__tests__/validations.test.ts
  • admin-ui/plugins/auth-server/components/Ssa/__tests__/helper/utils.test.ts
  • admin-ui/plugins/auth-server/components/Ssa/__tests__/helper/validations.test.ts
  • admin-ui/plugins/auth-server/components/Ssa/utils/__tests__/formValidationUtils.test.ts
  • admin-ui/plugins/fido/__tests__/helper/utils.test.ts
  • admin-ui/plugins/saml/__tests__/utils.test.ts
  • admin-ui/plugins/saml/__tests__/validations.test.ts
  • admin-ui/plugins/scripts/components/helper/__tests__/utils.test.ts
  • admin-ui/plugins/scripts/components/helper/__tests__/validations.test.ts
  • admin-ui/plugins/user-management/__tests__/helper/utils.test.ts

Comment thread admin-ui/plugins/user-management/__tests__/helper/utils.test.ts
… commit (#2915)

Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@duttarnab duttarnab merged commit c0cc69b into main Jul 2, 2026
8 checks passed
@duttarnab duttarnab deleted the admin-ui-issue-2915 branch July 2, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(admin-ui):add test cases for all remaining uncovered files

3 participants