diff --git a/tests/ui/dailies.spec.js b/tests/ui/dailies.spec.js index a849dd0..4744342 100644 --- a/tests/ui/dailies.spec.js +++ b/tests/ui/dailies.spec.js @@ -9,13 +9,13 @@ const KNOWN_CITY = 'Tokyo'; const KNOWN_COUNTRY = 'Japan'; // Use two fixture entries with different dates to verify descending order -const NEWER_SLUG = '2026-06-17.entry'; // most recent fixture (June 17) -const OLDER_SLUG = '2026-03-25-1540-wheels-down-narita.entry'; // oldest fixture (March 25) +const NEWER_SLUG = '2026-04-01-0900-seoul-calling.entry'; // newer fixture +const OLDER_SLUG = '2026-03-25-1540-wheels-down-narita.entry'; // older fixture // ── T1: Dailies page loads ───────────────────────────────────────────────────── test('T1: /trips/japan-korea-2026/dailies loads and shows at least one entry card', async ({ page }) => { await page.goto('/trips/japan-korea-2026/dailies'); - await expect(page.locator('.entry-card').first()).toBeVisible(); + await expect(page.locator('.journal-post').first()).toBeVisible(); await expect(page.locator('.site-header')).toBeVisible(); }); @@ -25,19 +25,19 @@ test('T1: /trips/japan-korea-2026/dailies loads and shows at least one entry car test('T2: dailies shows newer entries before older entries', async ({ page }) => { await page.goto('/trips/japan-korea-2026/dailies'); - // Both fixture entries must be visible on the page - const newerCard = page.locator(`.entry-card[href*="${NEWER_SLUG}"]`); - const olderCard = page.locator(`.entry-card[href*="${OLDER_SLUG}"]`); + // Use attribute selector to handle dots in slug names (CSS dots are class selectors) + const newerCard = page.locator(`.journal-post[id="entry-${NEWER_SLUG}"]`); + const olderCard = page.locator(`.journal-post[id="entry-${OLDER_SLUG}"]`); await expect(newerCard).toBeVisible(); await expect(olderCard).toBeVisible(); // The newer entry should appear higher in the DOM (lower index) const newerIdx = await newerCard.evaluate(el => { - return [...document.querySelectorAll('.entry-card')].findIndex(c => c === el); + return [...document.querySelectorAll('.journal-post')].findIndex(c => c.id === el.id); }); const olderIdx = await olderCard.evaluate(el => { - return [...document.querySelectorAll('.entry-card')].findIndex(c => c === el); + return [...document.querySelectorAll('.journal-post')].findIndex(c => c.id === el.id); }); expect(newerIdx).toBeLessThan(olderIdx); diff --git a/user b/user index f829da1..e7482e5 160000 --- a/user +++ b/user @@ -1 +1 @@ -Subproject commit f829da10eca597dfa59f93129a8e531c35a4dc05 +Subproject commit e7482e5bdd00805843b8864863d4afbd7cbb4db1