Files
monitoring-app/tests/integration/dashboard.test.ts
2026-04-02 10:30:21 +08:00

31 lines
1.1 KiB
TypeScript

import { test, expect, describe } from 'bun:test'
import { createTestApp } from '../helpers'
const app = createTestApp()
describe('Dashboard Routes (SPA)', () => {
test('GET /dashboard returns 200 HTML', async () => {
const res = await app.handle(new Request('http://localhost/dashboard'))
expect(res.status).toBe(200)
expect(res.headers.get('content-type')).toContain('text/html')
})
test('GET /apps returns 200 HTML', async () => {
const res = await app.handle(new Request('http://localhost/apps'))
expect(res.status).toBe(200)
expect(res.headers.get('content-type')).toContain('text/html')
})
test('GET /apps/desa-plus returns 200 HTML', async () => {
const res = await app.handle(new Request('http://localhost/apps/desa-plus'))
expect(res.status).toBe(200)
expect(res.headers.get('content-type')).toContain('text/html')
})
test('GET /settings returns 200 HTML', async () => {
const res = await app.handle(new Request('http://localhost/settings'))
expect(res.status).toBe(200)
expect(res.headers.get('content-type')).toContain('text/html')
})
})