Merged
Conversation
…o feat/forgot-password
…o feat/forgot-password
…o fix/verify-email-ui
…to fix/microsoft-bug
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive unit testing infrastructure to the authentication kit module using Vitest and React Testing Library, along with minor updates to the ProfilePage component to split name handling into separate first name, last name, and username fields.
Changes:
- Adds Vitest configuration with jsdom environment and centralized test setup
- Implements unit tests for utilities (JWT helpers, color helpers, auth interceptor), hooks (useAbility), contexts (AuthState, AuthConfig, Rbac), and components (SessionExpiredModal, RequirePermissions, InputField, InlineError)
- Adds comprehensive test infrastructure including required dependencies and npm scripts
- Updates ProfilePage to handle structured name fields (fname, lname, username) instead of a single name field
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Configures Vitest with jsdom environment and test file patterns |
| tests/setup.ts | Sets up React Testing Library with jest-dom matchers and cleanup |
| tests/utils/jwtHelpers.test.ts | Tests JWT token decoding with field mapping and defaults |
| tests/utils/colorHelpers.test.ts | Tests Tailwind color class conversion utility |
| tests/utils/attachAuthInterceptor.test.ts | Tests auth interceptor with token refresh and logout behavior |
| tests/providers/AuthProvider.test.tsx | Tests AuthProvider routing and authentication state |
| tests/hooks/useAbility.test.tsx | Tests role, module, and permission checking hooks |
| tests/context/RbacContext.test.tsx | Tests RBAC grant logic with permissions and roles |
| tests/context/AuthStateContext.test.tsx | Tests auth state context provider and consumer behavior |
| tests/context/AuthConfigContext.test.tsx | Tests auth config context provider and consumer behavior |
| tests/components/SessionExpiredModal.test.tsx | Tests modal rendering and body style management |
| tests/components/RequirePermissions.test.tsx | Tests permission-based access control component |
| tests/components/InputField.test.tsx | Tests input field rendering and change handling |
| tests/components/InlineError.test.tsx | Tests error display with auto-dismiss and manual dismiss |
| src/components/ProfilePage.tsx | Splits name into fname, lname, and username fields |
| package.json | Adds test dependencies and scripts, bumps version to 1.0.12 |
| README.md | Documents testing approach and commands |
Ciscode-Admin
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Checklist
npm run lintpassesnpm run typecheckpassesnpm testpassesnpm run buildpassesnpx changeset) if this affects consumersNotes