Files
monitoring-app/tests/e2e/landing-page.test.ts
bipproduction 08a1054e3c Initial commit: full-stack Bun + Elysia + React template
Elysia.js API with session-based auth (email/password + Google OAuth),
role system (USER/ADMIN/SUPER_ADMIN), Prisma + PostgreSQL, React 19
with Mantine UI, TanStack Router, dark theme, and comprehensive test
suite (unit, integration, E2E with Lightpanda).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 10:12:19 +08:00

50 lines
1.4 KiB
TypeScript

import { test, expect, describe } from 'bun:test'
import { createPage, APP_HOST } from './browser'
describe('E2E: Landing page', () => {
test('serves HTML with correct title', async () => {
const { page, cleanup } = await createPage()
try {
await page.goto(APP_HOST)
const title = await page.title()
expect(title).toBe('My App')
} finally {
cleanup()
}
})
test('has dark color-scheme meta tag', async () => {
const { page, cleanup } = await createPage()
try {
await page.goto(APP_HOST)
const meta = await page.evaluate('document.querySelector("meta[name=color-scheme]").content')
expect(meta).toBe('dark')
} finally {
cleanup()
}
})
test('splash screen removed after JS execution', async () => {
const { page, cleanup } = await createPage()
try {
await page.goto(APP_HOST)
// Lightpanda executes JS, so splash should be gone
const splashExists = await page.evaluate('document.getElementById("splash") !== null')
expect(splashExists).toBe(false)
} finally {
cleanup()
}
})
test('root div present', async () => {
const { page, cleanup } = await createPage()
try {
await page.goto(APP_HOST)
const root = await page.evaluate('document.getElementById("root") !== null')
expect(root).toBe(true)
} finally {
cleanup()
}
})
})