feat(admin-ui): add test files for all helpers and utility files across the system (#2891)#2894
Conversation
…ss the system (#2891) Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
📝 WalkthroughWalkthroughAdds 30+ new Jest test files across the admin-ui codebase, covering app-level utilities ( ChangesAdmin UI Unit Test Coverage Expansion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
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/Authentication/Acrs/helper/__tests__/acrUtils.test.ts`:
- Around line 90-92: The test named for the non-array guard in acrUtils.test.ts
is using an empty array, so it does not cover the invalid-input branch in
buildAgamaFlowsArray. Update this test to pass a true non-array value and keep
the assertion for an empty result, so the guard path in buildAgamaFlowsArray is
actually exercised.
In `@admin-ui/plugins/user-management/common/__tests__/Constants.test.ts`:
- Around line 38-45: The Constants.test currently only checks partial membership
for RESERVED_STANDARD_CLAIMS, so it can miss accidental changes to the
unasserted entries. Tighten the test in the Constants.test suite by replacing
the piecemeal contains/length checks with a single exact equality assertion
against the full expected array, using STANDARD_FORM_FIELDS and the reserved
symbols like USER_PASSWORD_ATTR and uid as the reference points.
🪄 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: ccea8001-719b-4eba-a826-c915d2c382d6
📒 Files selected for processing (34)
admin-ui/app/utils/__tests__/AuditLogger.test.tsadmin-ui/app/utils/__tests__/Util.test.tsadmin-ui/app/utils/__tests__/auditAction.test.tsadmin-ui/app/utils/__tests__/buttonUtils.test.tsadmin-ui/app/utils/__tests__/dayjsUtils.test.tsadmin-ui/app/utils/__tests__/errorHandler.test.tsadmin-ui/app/utils/__tests__/licenseUtils.test.tsadmin-ui/app/utils/__tests__/menuFilters.test.tsadmin-ui/app/utils/__tests__/pagingUtils.test.tsadmin-ui/app/utils/__tests__/placeholderUtils.test.tsadmin-ui/app/utils/__tests__/queryUtils.test.tsadmin-ui/app/utils/__tests__/regex.test.tsadmin-ui/app/utils/__tests__/stringUtils.test.tsadmin-ui/app/utils/validation/__tests__/commitMessage.test.tsadmin-ui/plugins/admin/components/Health/utils/__tests__/formatters.test.tsadmin-ui/plugins/admin/components/MAU/utils/__tests__/dataAugmentation.test.tsadmin-ui/plugins/admin/components/MAU/utils/__tests__/formatters.test.tsadmin-ui/plugins/admin/helper/__tests__/assets.test.tsadmin-ui/plugins/admin/helper/__tests__/settings.test.tsadmin-ui/plugins/admin/helper/__tests__/webhook.test.tsadmin-ui/plugins/admin/helper/validations/__tests__/assetValidation.test.tsadmin-ui/plugins/admin/helper/validations/__tests__/settingsValidation.test.tsadmin-ui/plugins/admin/helper/validations/__tests__/webhookValidation.test.tsadmin-ui/plugins/auth-server/common/__tests__/Constants.test.tsadmin-ui/plugins/auth-server/components/Authentication/Acrs/helper/__tests__/acrUtils.test.tsadmin-ui/plugins/auth-server/components/ConfigApiProperties/utils/__tests__/typeGuards.test.tsadmin-ui/plugins/auth-server/components/ConfigApiProperties/utils/__tests__/useConfigApiActions.test.tsadmin-ui/plugins/auth-server/components/ConfigApiProperties/utils/__tests__/valueUtils.test.tsadmin-ui/plugins/auth-server/components/Ssa/utils/__tests__/dateFormatters.test.tsadmin-ui/plugins/auth-server/components/Ssa/utils/__tests__/fileDownload.test.tsadmin-ui/plugins/auth-server/redux/utils/__tests__/auditHelpers.test.tsadmin-ui/plugins/auth-server/utils/__tests__/clientUtils.test.tsadmin-ui/plugins/scripts/components/helper/__tests__/auditUtils.test.tsadmin-ui/plugins/user-management/common/__tests__/Constants.test.ts
|
|



feat(admin-ui): add test files for all helpers and utility files across the system (#2891)
Summary
This PR expands automated test coverage across the Admin UI by adding test files for helper and utility modules throughout the codebase.
The objective is to ensure shared business logic, data transformations, validation helpers, formatting utilities, and common helper functions are covered by automated tests. This improves confidence in core functionality, reduces regression risk, and strengthens the overall Jest test suite.
Fix Summary
Verification
passes successfully.
🔗 Ticket
Closes: #2891
Summary by CodeRabbit