diff --git a/app/src/components/settings/account/ProfileSettings.test.tsx b/app/src/components/settings/account/ProfileSettings.test.tsx index 124022d..4aef72b 100644 --- a/app/src/components/settings/account/ProfileSettings.test.tsx +++ b/app/src/components/settings/account/ProfileSettings.test.tsx @@ -4,6 +4,25 @@ import React from 'react'; import { MantineProvider } from '@mantine/core'; import ProfileSettings from './ProfileSettings'; import type { UserProfileSettings } from '@/types/models'; +import { Theme, UserRole, type User } from '@/types/models'; + +// Mock user for AuthContext +const mockUser: User = { + id: 1, + email: 'test@example.com', + displayName: 'Test User', + role: UserRole.Editor, + theme: Theme.Dark, + createdAt: '2024-01-01T00:00:00Z', + lastWorkspaceId: 1, +}; + +// Mock the auth context +vi.mock('../../../contexts/AuthContext', () => ({ + useAuth: () => ({ + user: mockUser, + }), +})); // Helper wrapper component for testing const TestWrapper = ({ children }: { children: React.ReactNode }) => ( diff --git a/app/src/types/models.test.ts b/app/src/types/models.test.ts index 8a27ea9..4b83318 100644 --- a/app/src/types/models.test.ts +++ b/app/src/types/models.test.ts @@ -188,6 +188,7 @@ describe('Models Type Guards', () => { id: 1, email: 'test@example.com', role: UserRole.Editor, + theme: Theme.Dark, createdAt: '2024-01-01T00:00:00Z', lastWorkspaceId: 1, __proto__: { malicious: true }, @@ -773,6 +774,7 @@ describe('Models Type Guards', () => { id: 1, email: 'test@example.com', role: UserRole.Editor, + theme: Theme.Dark, createdAt: '2024-01-01T00:00:00Z', lastWorkspaceId: 1, }; @@ -806,6 +808,7 @@ describe('Models Type Guards', () => { id: 1, email: 'test@example.com', role: UserRole.Editor, + theme: Theme.Dark, createdAt: '2024-01-01T00:00:00Z', lastWorkspaceId: 1, }); @@ -854,6 +857,7 @@ describe('Models Type Guards', () => { id: 1, email: longString, role: UserRole.Editor, + theme: Theme.Dark, createdAt: '2024-01-01T00:00:00Z', lastWorkspaceId: 1, };