feat: add more roles (tech_lead, scrum_master, product_owner, designer, qa)
- Registration form: added 5 new role options to dropdown - Sidebar: new roles get proper nav access via ALL_ROLES/LEADER_ROLES - Dashboard: isLeader check expanded to include new leadership roles - Shared/Pages: role badge colors added for all new roles - Invite modal: expanded role dropdown
This commit is contained in:
36
tests/integration/health.test.ts
Normal file
36
tests/integration/health.test.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
// fetch is global in Node 18+
|
||||
|
||||
describe('Integration Tests', () => {
|
||||
const FRONTEND_URL = 'http://localhost:80';
|
||||
const BACKEND_URL = 'http://localhost:3001';
|
||||
|
||||
it('Frontend is reachable', async () => {
|
||||
try {
|
||||
const res = await fetch(FRONTEND_URL);
|
||||
expect(res.status).toBe(200);
|
||||
const text = await res.text();
|
||||
expect(text).toContain('<!doctype html>');
|
||||
} catch (e) {
|
||||
// If fetch fails (connection refused), test fails
|
||||
throw new Error(`Frontend not reachable at ${FRONTEND_URL}: ${e.message}`);
|
||||
}
|
||||
});
|
||||
|
||||
it('Backend health check / API is reachable', async () => {
|
||||
// We don't have a specific health endpoint, but we can try to hit an auth endpoint
|
||||
// that requires valid input, expecting a 400 or 401 instead of connection refused.
|
||||
try {
|
||||
const res = await fetch(`${BACKEND_URL}/api/auth/login`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({})
|
||||
});
|
||||
// Expecting 400 because we sent empty body, meaning server is up and parsing JSON
|
||||
expect(res.status).toBe(400);
|
||||
} catch (e) {
|
||||
throw new Error(`Backend not reachable at ${BACKEND_URL}: ${e.message}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user