unit tests fixin
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 42s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 42s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { render, screen, fireEvent, waitFor, cleanup } from '@testing-library/react';
|
||||
import { describe, it, expect, vi, beforeEach, afterEach, type Mock } from 'vitest';
|
||||
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { describe, it, expect, vi, beforeEach, type Mock } from 'vitest';
|
||||
import { ProfileManager } from './ProfileManager';
|
||||
import * as apiClient from '../services/apiClient'; // Import the entire module to mock functions
|
||||
import { notifySuccess, notifyError } from '../services/notificationService'; // Import the notification service to check calls
|
||||
@@ -49,22 +49,6 @@ const defaultProps = {
|
||||
onLoginSuccess: mockOnLoginSuccess,
|
||||
};
|
||||
|
||||
const authenticatedUser = { id: 'auth-user-123', email: 'test@example.com' };
|
||||
const authenticatedProfile = {
|
||||
id: 'auth-user-123',
|
||||
full_name: 'Test User',
|
||||
avatar_url: 'http://example.com/avatar.png',
|
||||
role: 'user' as const,
|
||||
preferences: { darkMode: false, unitSystem: 'imperial' as const },
|
||||
};
|
||||
|
||||
const authenticatedProps = {
|
||||
...defaultProps,
|
||||
user: authenticatedUser,
|
||||
profile: authenticatedProfile,
|
||||
authStatus: 'AUTHENTICATED' as const,
|
||||
};
|
||||
|
||||
describe('ProfileManager Authentication Flows', () => {
|
||||
beforeEach(() => {
|
||||
// Reset all mocks before each test
|
||||
|
||||
Reference in New Issue
Block a user