Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,22 @@ test('icons stay within their controls on desktop and mobile', async ({
}
});

test('clicking anywhere on a recipe card, including its image, opens the recipe', async ({
page,
}) => {
// The title link's ::after overlay (RecipeCard.css) covers the whole card.
// jsdom cannot hit-test CSS, so this is checked in a real browser.
await page.goto('.');
const image = page.locator('.recipe-card__image').first();
await expect(image).toBeVisible();
const box = (await image.boundingBox())!;
await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);
await expect(page).toHaveURL(/recipes\/11111111-1111-4111-8111-111111111111/);
await expect(
page.getByRole('heading', { name: 'Creamy salmon pasta' }),
).toBeVisible();
});

test('renders each core route through the shared shell', async ({ page }) => {
for (const [path, title] of coreRoutes) {
await page.goto(path === '/' ? '.' : path.slice(1));
Expand Down