Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive unit test coverage across the codebase, focusing on storage management, authentication flows, API clients, and utility functions. The tests improve code reliability by validating core functionality including token handling, OIDC flows, passkey authentication, and various authentication methods.
- Adds test coverage for storage implementations (MemoryStore, LocalStorageStore) and StorageManager
- Implements extensive tests for authentication transactions, RBA client, and auth client methods
- Expands API function tests and adds coverage for crypto utilities and browser helpers
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/storage/StorageManager.test.ts | Updated test description and added tests for token removal errors, expired token cleanup, and IDaaS session token storage |
| test/unit/storage/MemoryStore.test.ts | New test file covering basic CRUD operations for in-memory storage |
| test/unit/storage/LocalStorageStore.test.ts | New test file validating localStorage-backed storage implementation |
| test/unit/passkey.test.ts | Added tests for buildPubKeyRequestOptions and updated buildFidoResponse tests |
| test/unit/jwt.test.ts | Enhanced JWT validation tests including missing alg claim and improved expired token test |
| test/unit/helpers.ts | Updated mockFetch to return proper Response objects instead of partial mocks |
| test/unit/crypto.test.ts | New test file for crypto utility functions including random string generation and challenge pairs |
| test/unit/browser.test.ts | Expanded browser utility tests including popup management and authorization listener |
| test/unit/api.test.ts | Significantly expanded API tests covering all major endpoints and error handling |
| test/unit/RbaClient.test.ts | New comprehensive test file for RBA client authentication flows |
| test/unit/OidcClient.popup.test.ts | New test file validating popup-based OIDC login flow |
| test/unit/IdaasContext.test.ts | New test file covering context initialization and OIDC config caching |
| test/unit/IdaasClient/login.test.ts | Updated login tests with better fetch mocking and validation |
| test/unit/IdaasClient/handleRedirect.test.ts | Enhanced redirect handling tests with better error coverage |
| test/unit/IdaasClient/getters.test.ts | New test file validating client getter methods |
| test/unit/IdaasClient/getUserInfo.test.ts | Added test for JWT userinfo response handling |
| test/unit/IdaasClient/getIdTokenClaims.test.ts | Added test for missing decoded claims scenario |
| test/unit/IdaasClient/getAccessToken.test.ts | Enhanced access token tests with better coverage of edge cases |
| test/unit/AuthenticationTransaction.test.ts | New extensive test file covering all authentication transaction scenarios |
| test/unit/AuthClient.test.ts | New comprehensive test file for all auth client methods including passkey and biometric |
| src/utils/passkey.ts | Refactored to extract response into a variable for better readability |
| src/storage/MemoryStore.ts | Added explicit constructor for test coverage tracking |
| src/storage/LocalStorageStore.ts | Added explicit constructor for test coverage tracking |
| src/api.ts | Added URL normalization to trim whitespace and trailing slashes |
| src/IdaasClient.ts | Removed private storageManager getter previously used for testing |
| bunfig.toml | Added coverage thresholds and expanded ignore patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c3d5089 to
feb9a4d
Compare
feb9a4d to
4150580
Compare
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.
codex did the work.