more refactor
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled
This commit is contained in:
@@ -56,7 +56,7 @@ vi.mock('../services/logger.server', () => ({
|
||||
vi.mock('./passport.routes', () => ({
|
||||
default: {
|
||||
authenticate: vi.fn(() => (req: Request, res: Response, next: NextFunction) => {
|
||||
req.user = createMockUserProfile({ role: 'admin' });
|
||||
req.user = createMockUserProfile({ role: 'admin', user: { user_id: 'admin-user-id', email: 'admin@test.com' } });
|
||||
next();
|
||||
}),
|
||||
},
|
||||
@@ -64,7 +64,7 @@ vi.mock('./passport.routes', () => ({
|
||||
}));
|
||||
|
||||
describe('Admin System Routes (/api/admin/system)', () => {
|
||||
const adminUser = createMockUserProfile({ role: 'admin' });
|
||||
const adminUser = createMockUserProfile({ role: 'admin', user: { user_id: 'admin-user-id', email: 'admin@test.com' } });
|
||||
const app = createTestApp({ router: adminRouter, basePath: '/api/admin', authenticatedUser: adminUser });
|
||||
|
||||
// Add a basic error handler to capture errors passed to next(err) and return JSON.
|
||||
|
||||
Reference in New Issue
Block a user