Add extensive form tests and enhanced error handling for auth components.
- Introduced comprehensive tests for `RegisterForm`, `PasswordResetRequestForm`, and `PasswordResetConfirmForm` covering successful submissions, validation errors, and API error handling. - Refactored forms to handle unexpected errors gracefully and improve test coverage for edge cases. - Updated `crypto` and `storage` modules with robust error handling for storage issues and encryption key management. - Removed unused `axios-mock-adapter` dependency for cleaner dependency management.
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
// Learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom'
|
||||
import 'whatwg-fetch'; // Polyfill fetch API for MSW
|
||||
import 'whatwg-fetch'; // Polyfill fetch API
|
||||
import { Crypto } from '@peculiar/webcrypto';
|
||||
|
||||
// Polyfill TransformStream for nock/msw
|
||||
if (typeof global.TransformStream === 'undefined') {
|
||||
const { TransformStream } = require('node:stream/web');
|
||||
global.TransformStream = TransformStream;
|
||||
}
|
||||
|
||||
// Mock window object
|
||||
global.window = global.window || {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user