import { test, expect } from '@playwright/test'; const PAGES = ['/', '/trades', '/knowledge-work', '/english', '/math', '/teaching', '/knowledge-work/using-ai', '/research', '/privacy', '/login']; test.describe('Public pages', () => { for (const path of PAGES) { test(`${path} loads`, async ({ page }) => { const response = await page.goto(path); expect(response?.status()).toBe(200); await expect(page.locator('h1').first()).toBeVisible(); }); } test('home is plain Become a Pro text', async ({ page }) => { await page.goto('/'); await expect(page.locator('h1')).toHaveText('Become a Pro'); const html = await page.content(); expect(html).not.toMatch(/AI Resource|youtube|three\.js/i); }); test('a lesson renders with its updated date', async ({ page }) => { await page.goto('/knowledge-work/using-ai/claude-md-guide'); await expect(page.locator('h1')).toContainText('CLAUDE.md'); await expect(page.getByText(/Updated/)).toBeVisible(); }); test('old tutorial paths redirect to Using AI at work', async ({ page }) => { await page.goto('/claude/claude-md-guide'); expect(new URL(page.url()).pathname).toBe('/knowledge-work/using-ai/claude-md-guide'); }); test('unknown area returns 404', async ({ page }) => { const response = await page.goto('/not-an-area'); expect(response?.status()).toBe(404); }); });