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>
This commit is contained in:
49
tests/e2e/landing-page.test.ts
Normal file
49
tests/e2e/landing-page.test.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
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()
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user