more refactor
Some checks failed
Deploy to Test Environment / deploy-to-test (push) Has been cancelled

This commit is contained in:
2025-12-21 20:34:32 -08:00
parent 15f759cbc4
commit bc2c24bcff
46 changed files with 387 additions and 257 deletions

View File

@@ -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.