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

test.describe('Marketing hero CTA smoke', () => {
  test('home hero CTA navigates to packages', async ({ page, baseURL }) => {
    test.skip(!baseURL, 'baseURL is required to run marketing smoke tests');

    await page.goto('/');

    const cta = page.locator('#hero').getByRole('link', {
      name: /Pakete ansehen|Pakete entdecken|Discover Packages/i,
    });

    await expect(cta).toBeVisible();
    await cta.click();

    await expect(page).toHaveURL(/\/packages/);
  });

  test('packages hero CTA jumps to endcustomer section', async ({ page, baseURL }) => {
    test.skip(!baseURL, 'baseURL is required to run marketing smoke tests');

    await page.goto('/packages');

    const cta = page.getByRole('link', {
      name: /Pakete entdecken|Discover Packages/i,
    });

    await expect(cta).toBeVisible();
    await cta.click();

    await expect(page.locator('#packages-showcase')).toBeVisible();
  });
});
