complete project using prettier!

This commit is contained in:
2025-12-22 09:45:14 -08:00
parent 621d30b84f
commit a10f84aa48
339 changed files with 18041 additions and 8969 deletions

View File

@@ -37,7 +37,9 @@ vi.mock('@bull-board/api/bullMQAdapter');
vi.mock('@bull-board/express', () => ({
ExpressAdapter: class {
setBasePath = vi.fn();
getRouter = vi.fn().mockReturnValue((req: Request, res: Response, next: NextFunction) => next());
getRouter = vi
.fn()
.mockReturnValue((req: Request, res: Response, next: NextFunction) => next());
},
}));
@@ -56,7 +58,10 @@ vi.mock('../services/logger.server', () => ({
vi.mock('./passport.routes', () => ({
default: {
authenticate: vi.fn(() => (req: Request, res: Response, next: NextFunction) => {
req.user = createMockUserProfile({ role: 'admin', user: { user_id: 'admin-user-id', email: 'admin@test.com' } });
req.user = createMockUserProfile({
role: 'admin',
user: { user_id: 'admin-user-id', email: 'admin@test.com' },
});
next();
}),
},
@@ -64,8 +69,15 @@ vi.mock('./passport.routes', () => ({
}));
describe('Admin System Routes (/api/admin/system)', () => {
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 });
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.
// This prevents unhandled error crashes in tests and ensures we get the 500 response we expect.
@@ -92,4 +104,4 @@ describe('Admin System Routes (/api/admin/system)', () => {
expect(response.body.message).toContain('Redis is down');
});
});
});
});