ensure mocks are used wherever possible, more test fixes
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 1h7m5s

This commit is contained in:
2025-12-20 15:33:08 -08:00
parent bf4646fbe5
commit 56981236ab
48 changed files with 1200 additions and 499 deletions

View File

@@ -5,6 +5,7 @@ import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
import { AuthView } from './AuthView';
import * as apiClient from '../../../services/apiClient';
import { notifySuccess, notifyError } from '../../../services/notificationService';
import { createMockUser } from '../../../tests/utils/mockFactories';
const mockedApiClient = vi.mocked(apiClient, true);
@@ -18,7 +19,7 @@ const defaultProps = {
const setupSuccessMocks = () => {
const mockAuthResponse = {
user: { user_id: '123', email: 'test@example.com' },
user: createMockUser({ user_id: '123', email: 'test@example.com' }),
token: 'mock-token',
};
(mockedApiClient.loginUser as Mock).mockResolvedValue(new Response(JSON.stringify(mockAuthResponse)));