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

test.describe('Legal Pages - Warum wir removed', () => {

  test.beforeEach(async ({ page }) => {
    await page.goto('/');
    await page.waitForLoadState('domcontentloaded');
  });

  test('Impressum page - Warum wir nav link removed', async ({ page }) => {
    await page.goto('/impressum.html');
    await expect(page.getByText('Warum wir')).not.toBeVisible();
  });

  test('AGB page - Warum wir nav link removed', async ({ page }) => {
    await page.goto('/agb.html');
    await expect(page.getByText('Warum wir')).not.toBeVisible();
  });

  test('Datenschutz page - Warum wir nav link removed', async ({ page }) => {
    await page.goto('/datenschutz.html');
    await expect(page.getByText('Warum wir')).not.toBeVisible();
  });

  test('Mietbedingungen page - Warum wir nav link removed', async ({ page }) => {
    await page.goto('/mietbedingungen.html');
    await expect(page.getByText('Warum wir')).not.toBeVisible();
  });

  test('All legal pages - other nav links present', async ({ page }) => {
    await page.goto('/impressum.html');
    const nav = page.getByLabel('Hauptnavigation');
    await expect(nav.getByRole('link', { name: 'Fahrzeuge' }).first()).toBeVisible();
    await expect(nav.getByRole('link', { name: 'Buchen' }).first()).toBeVisible();
  });
});
