import { expect, test } from '@playwright/test'; test.describe('property directory', () => { test('shows the real-data listing page from navigation', async ({ page }) => { await page.goto('/'); await page.getByRole('link', { name: 'Properties' }).click(); await expect(page).toHaveURL('/properties'); await expect(page.getByRole('heading', { name: 'Search live stay rules before the booking form starts' })).toBeVisible(); await expect(page.getByRole('heading', { name: 'Coastal View Cottage' })).toBeVisible(); await expect(page.getByRole('link', { name: 'Start booking' }).first()).toHaveAttribute( 'href', '/bookings/new?propertySlug=coastal-view-cottage', ); }); test('filters properties by dates and pet-friendly toggle', async ({ page }) => { await page.goto( '/properties?arrivalDate=2026-07-10&departureDate=2026-07-14&adults=2&children=0&pets=1&petsAllowed=true', ); await expect(page.getByRole('heading', { name: 'Orchard Barn' })).toBeVisible(); await expect(page.getByText('Available for these dates')).toBeVisible(); await expect(page.getByRole('heading', { name: 'Coastal View Cottage' })).toHaveCount(0); await expect(page.getByRole('heading', { name: 'Harbour House' })).toHaveCount(0); }); test('shows an empty state when filters exclude every property', async ({ page }) => { await page.goto('/properties?location=harbour&bedrooms=4'); await expect(page.getByRole('heading', { name: 'No properties matched this combination' })).toBeVisible(); }); });