Skip to content

Commit 3b5aad5

Browse files
committed
fix(e2e): decouple smoke home test from featured collection image
The smoke home test asserted that the featured collection hero rendered an `<img>`. The featured collection is the most-recently-updated collection in the preview store (`sortKey: UPDATED_AT`), and its image is optional in the template (`{image && ...}` in _index.tsx). When the newest collection has no image (currently "Freeride"), the hero renders only its heading and the test times out waiting for an image that is never present. Assert the featured collection heading (`h1`, the collection title, which is always present) instead, per the "Dynamic Store Data" guidance in e2e/CLAUDE.md. The product grid image assertion still verifies Image rendering against reliable product data.
1 parent 5ac0e85 commit 3b5aad5

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

e2e/specs/smoke/home.spec.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {test, expect, setTestStore} from '../../fixtures';
33
setTestStore('hydrogenPreviewStorefront');
44

55
test.describe('Home Page', () => {
6-
test('should display hero image, product grid, and no console errors', async ({
6+
test('should display featured collection, product grid, and no console errors', async ({
77
page,
88
}) => {
99
const consoleErrors: string[] = [];
@@ -15,20 +15,15 @@ test.describe('Home Page', () => {
1515

1616
await page.goto('/');
1717

18-
const heroImage = page
19-
.getByRole('link')
20-
.filter({
21-
has: page.getByRole('heading', {level: 1}),
22-
})
23-
.getByRole('img');
18+
const featuredCollectionHeading = page.getByRole('heading', {level: 1});
2419

2520
const productGridImage = page
2621
.getByRole('region', {name: 'Recommended Products'})
2722
.getByRole('link')
2823
.first()
2924
.getByRole('img');
3025

31-
await expect(heroImage).toBeVisible();
26+
await expect(featuredCollectionHeading).toBeVisible();
3227
await expect(productGridImage).toBeVisible();
3328

3429
expect(consoleErrors).toHaveLength(0);

0 commit comments

Comments
 (0)