Skip to content

Commit 2577d82

Browse files
committed
fix(tests): align context mocks with Auth/Theme contracts
Add missing user, session, loading fields to useAuth mock and setTheme to useTheme mock to match the real context APIs.
1 parent c878ece commit 2577d82

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

__tests__/components/settings/SettingsContent.analytics.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ const mockRefreshProfile = jest.fn().mockResolvedValue(undefined);
172172
// Mock AuthContext - uses mockProfile variable which can be modified between tests
173173
jest.mock('@/contexts/AuthContext', () => ({
174174
useAuth: () => ({
175+
user: null,
176+
session: null,
177+
loading: false,
175178
signOut: jest.fn(),
176179
deleteAccount: jest.fn(),
177180
profile: mockProfile,
@@ -208,6 +211,7 @@ jest.mock('@/contexts/ThemeContext', () => ({
208211
fontBold: 'JetBrainsMono_700Bold',
209212
},
210213
themeMode: 'system',
214+
setTheme: jest.fn(),
211215
setThemeMode: jest.fn(),
212216
isDark: false,
213217
}),

0 commit comments

Comments
 (0)