import { test, expect } from '@playwright/test';

const pages = [
  { path: '/', heading: /Welcome back|Get set up|Sent today/i },
  { path: '/channels', heading: /Channels|Providers/i },
  { path: '/apps', heading: /Apps/i },
  { path: '/messages', heading: /Messages/i },
  { path: '/templates', heading: /Templates/i },
  { path: '/logs', heading: /Logs/i },
  { path: '/insights', heading: /Insights/i },
  { path: '/settings', heading: /Settings|Appearance/i },
] as const;

test.describe('dashboard nav pages', () => {
  for (const pageDef of pages) {
    test(`loads ${pageDef.path}`, async ({ page }) => {
      await page.goto(pageDef.path);
      await expect(page.getByText('Zyphon').first()).toBeVisible();
      await expect(page.getByRole('heading').first()).toBeVisible();
      await expect(page.locator('main')).toContainText(pageDef.heading);
    });
  }
});
