feat(admin-ui): add test cases for all remaining uncovered files (#2915)#2916
Conversation
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
|
Warning Review limit reached
Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe 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. ChangesAdmin UI shell and shared utilities
Auth server helper tests
Plugin helper tests
User management helper tests
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
There was a problem hiding this comment.
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
📒 Files selected for processing (25)
admin-ui/app/components/App/__tests__/AppMain.test.tsxadmin-ui/app/components/Layout/__tests__/Layout.test.tsxadmin-ui/app/components/Layout/__tests__/LayoutContent.test.tsxadmin-ui/app/components/Layout/__tests__/LayoutSidebar.test.tsxadmin-ui/app/components/Layout/__tests__/withPageConfig.test.tsxadmin-ui/app/components/Theme/__tests__/ThemeClass.test.tsxadmin-ui/app/components/Theme/__tests__/ThemeProvider.test.tsxadmin-ui/app/routes/Dashboards/Chart/__tests__/utils.test.tsadmin-ui/app/utils/__tests__/ApiResources.test.tsadmin-ui/orval/__tests__/axiosInstance.test.tsadmin-ui/plugins/auth-server/components/AuthServerProperties/Properties/utils/__tests__/validations.test.tsadmin-ui/plugins/auth-server/components/Authentication/Acrs/helper/__tests__/validations.test.tsadmin-ui/plugins/auth-server/components/Authentication/AgamaFlows/__tests__/helper/utils.test.tsadmin-ui/plugins/auth-server/components/ConfigApiProperties/utils/__tests__/validations.test.tsadmin-ui/plugins/auth-server/components/Logging/__tests__/utils.test.tsadmin-ui/plugins/auth-server/components/Logging/__tests__/validations.test.tsadmin-ui/plugins/auth-server/components/Ssa/__tests__/helper/utils.test.tsadmin-ui/plugins/auth-server/components/Ssa/__tests__/helper/validations.test.tsadmin-ui/plugins/auth-server/components/Ssa/utils/__tests__/formValidationUtils.test.tsadmin-ui/plugins/fido/__tests__/helper/utils.test.tsadmin-ui/plugins/saml/__tests__/utils.test.tsadmin-ui/plugins/saml/__tests__/validations.test.tsadmin-ui/plugins/scripts/components/helper/__tests__/utils.test.tsadmin-ui/plugins/scripts/components/helper/__tests__/validations.test.tsadmin-ui/plugins/user-management/__tests__/helper/utils.test.ts
… commit (#2915) Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
|



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
Verification
passes successfully.
🔗 Ticket
Closes: #2915
Summary by CodeRabbit