chore: baseline plantilla-proyectos como base del CRM
This commit is contained in:
21
frontend/src/lib/backend.test.ts
Normal file
21
frontend/src/lib/backend.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
|
||||
// Solo en entorno con DNS `backend` (p. ej. red Docker) y con backend levantado; en Jenkins/CI se omite.
|
||||
const skipHttpIntegration = process.env.CI === 'true' || Boolean(process.env.JENKINS_URL)
|
||||
|
||||
describe.skipIf(skipHttpIntegration)('backend — health check', () => {
|
||||
|
||||
it('el backend esta corriendo y responde', async () => {
|
||||
const response = await fetch('http://backend:8000/api/health')
|
||||
expect(response.status).toBe(200)
|
||||
})
|
||||
|
||||
it('el endpoint de facturas responde', async () => {
|
||||
const response = await fetch('http://backend:8000/api/v1/a76/invoices/?company_id=1', {
|
||||
headers: { 'Authorization': 'Bearer test' }
|
||||
})
|
||||
// 200 con datos o 401/403 sin token valido — ambos significan que el backend esta vivo
|
||||
expect([200, 401, 403, 422]).toContain(response.status)
|
||||
})
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user