import { test, expect } from '@playwright/test'; // The /verify-email route was missing entirely, so the link in every verification // email rendered a blank page. These cover the route existing and reporting an // outcome; a happy-path test would need a real token out of the database. test.describe('Email verification', () => { test('reports an invalid token instead of rendering nothing', async ({ page }) => { await page.goto('/verify-email?token=not-a-real-token'); await expect(page.getByRole('heading', { name: 'Email verification' })).toBeVisible(); await expect(page.getByText('invalid or expired token')).toBeVisible(); }); test('reports a link with no token at all', async ({ page }) => { await page.goto('/verify-email'); await expect(page.getByRole('heading', { name: 'Email verification' })).toBeVisible(); await expect(page.getByText('This link is missing its verification token.')).toBeVisible(); }); });