Implement property directory search

This commit is contained in:
2026-05-26 11:59:22 +00:00
parent ab2f9677fa
commit bb80906d19
8 changed files with 621 additions and 86 deletions

View File

@@ -6,8 +6,9 @@ test.describe('homepage', () => {
await expect(page.getByRole('heading', { name: 'Holiday Property Booking' })).toBeVisible();
await expect(page.getByRole('navigation', { name: 'Primary' })).toBeVisible();
await expect(page.getByRole('link', { name: 'Explore featured stays' })).toHaveAttribute('href', '#browse');
await expect(page.getByRole('link', { name: 'Browse all properties' })).toHaveAttribute('href', '/properties');
await expect(page.getByRole('link', { name: 'Contact the team' })).toHaveAttribute('href', '/contact');
await expect(page.getByRole('link', { name: 'Properties' })).toHaveAttribute('href', '/properties');
});
test('shows the public content sections', async ({ page }) => {

View File

@@ -0,0 +1,34 @@
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();
});
});