/**
 * Public site smoke coverage.
 *
 * These routes are anonymous and should stay renderable even when CMS-backed
 * data falls back to defaults. The test checks for a meaningful heading and
 * absence of common Next.js error overlay text.
 */
import { test, expect } from '@playwright/test';
import { PORTALS } from '../../fixtures/users';

const PUBLIC_ROUTES = [
  '/',
  '/about',
  '/doctors',
  '/specialties',
  '/packages',
  '/faq',
  '/contact',
  '/privacy',
  '/terms',
] as const;

for (const route of PUBLIC_ROUTES) {
  test(`public route renders: ${route}`, async ({ page }) => {
    await page.goto(`${PORTALS.public}${route}`);
    await expect(page.getByRole('heading').first()).toBeVisible();
    await expect(page.getByText('Unhandled Runtime Error')).toHaveCount(0);
    await expect(page.getByText('Application error')).toHaveCount(0);
  });
}
