Unit tests on @ketopath/auth (added to the Vitest workspace): - readAuthEnv accepts a valid configuration - rejects secret < 32 chars and non-URL BETTER_AUTH_URL - preserves Google credentials when both vars are set Playwright e2e/auth.spec.ts: - happy path: sign-up creates a user, redirects home with welcome message, sign-out clears session, sign-in with the same credentials restores it - error path: invalid credentials surface a role="alert" message - each test uses a unique generated email to avoid DB collisions home.spec.ts: links instead of buttons (CTAs are now next/link). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
533 B
TypeScript
12 lines
533 B
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
test('home page renders Italian copy and CTAs', async ({ page }) => {
|
|
await page.goto('/');
|
|
|
|
await expect(page).toHaveTitle(/KetoPath/);
|
|
await expect(page.getByRole('heading', { name: 'KetoPath' })).toBeVisible();
|
|
await expect(page.getByRole('link', { name: 'Inizia gratis' })).toBeVisible();
|
|
await expect(page.getByRole('link', { name: 'Scopri come funziona' })).toBeVisible();
|
|
await expect(page.getByText(/non sostituiscono il parere di un medico/)).toBeVisible();
|
|
});
|