ensure mocks are used wherever possible, more test fixes
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 1h7m5s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 1h7m5s
This commit is contained in:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user