Skip to content

Commit c7d252f

Browse files
committed
fix(frontend): fix test for previous commit
1 parent 37592fc commit c7d252f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

frontend/src/pages/SupportAdmin.test.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
import { screen } from '@testing-library/react';
2-
import { describe, expect, it } from 'vitest';
2+
import { describe, expect, it, vi } from 'vitest';
33
import { renderWithRouter } from '../utils/test-utils';
44
import Support from './Support';
55

6+
// Mock the userStore
7+
vi.mock('../stores/userStore', () => ({
8+
default: {
9+
user: {
10+
id: 1,
11+
firstName: 'Test',
12+
lastName: 'User',
13+
loginId: 'testuser',
14+
active: true,
15+
userProfile: 'SUPPORT',
16+
version: 1,
17+
lastModifiedTimestamp: new Date().toISOString()
18+
},
19+
authorization: 'SUPPORT',
20+
isLoading: false,
21+
error: null
22+
}
23+
}));
24+
625
describe('Support Page', () => {
726
it('renders the Support / Admin View heading', () => {
827
renderWithRouter(<Support />);

0 commit comments

Comments
 (0)