test: re-point suite off retired standalone views
Phase-1 fallout: delete tests for deleted pages, re-point moved-behavior tests to the trip/home page where the content now lives. - maps.spec: keep M4/M7/M8 (home+trip maps); drop M1-3,5,6,9-11 (/map, /dailies & /stories mini-maps) - map-ux: re-point MUX4/5 sort toggle to #trip-sort-toggle on trip page - nav: N1->trip page, N2->home, drop N3 (/stats) + N5 (obsolete skip) - dailies: T1->trip page; T2->trip page with oldest-first assertion; fix T3-T6 stale entry-detail selectors (.entry-* -> .journal-post-*, pre-existing failures from an earlier entry redesign) - stories: S1/S5 -> trip feed story cards ([data-type=story]) - gpx-journey: load MapUtils from the trip page instead of /map - a11y: A4 photo strips -> trip page; drop AX3 (covered by AX2) - post/helpers: verify posted entry on the trip page (ACTIVE_TRIP_URL) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -12,17 +12,19 @@ const KNOWN_COUNTRY = 'Italy';
|
||||
const NEWER_SLUG = '2023-10-18-hunting-the-mother-of-georgia-from-above.entry'; // newest date in that trip
|
||||
const OLDER_SLUG = '2023-08-28-welcome-to-my-central-asian-picture-diary.entry'; // oldest date in that trip
|
||||
|
||||
// ── T1: Dailies page loads ─────────────────────────────────────────────────────
|
||||
test('T1: /trips/italy-2026-demo/dailies loads and shows at least one entry card', async ({ page }) => {
|
||||
await page.goto('/trips/italy-2026-demo/dailies');
|
||||
// ── T1: Trip page journal feed loads ──────────────────────────────────────────
|
||||
// The journal feed moved onto the trip page when the standalone /dailies view was retired.
|
||||
test('T1: trip page loads and shows at least one journal entry card', async ({ page }) => {
|
||||
await page.goto('/trips/italy-2026-demo');
|
||||
await expect(page.locator('.journal-post').first()).toBeVisible();
|
||||
await expect(page.locator('.site-header')).toBeVisible();
|
||||
});
|
||||
|
||||
// ── T2: Entries are newest-first ──────────────────────────────────────────────
|
||||
// ── T2: Trip feed default order is oldest-first ───────────────────────────────
|
||||
// The trip page sorts the feed oldest→newest by default (home uses newest-first).
|
||||
// Verify using two known real entries from central-asia-2023 (22 entries, stable order).
|
||||
test('T2: dailies shows newer entries before older entries', async ({ page }) => {
|
||||
await page.goto('/trips/central-asia-2023/dailies');
|
||||
test('T2: trip feed shows older entries before newer entries (oldest-first default)', async ({ page }) => {
|
||||
await page.goto('/trips/central-asia-2023');
|
||||
|
||||
// Use attribute selector to handle dots in slug names (CSS dots are class selectors)
|
||||
const newerCard = page.locator(`.journal-post[id="entry-${NEWER_SLUG}"]`);
|
||||
@@ -31,7 +33,7 @@ test('T2: dailies shows newer entries before older entries', async ({ page }) =>
|
||||
await expect(newerCard).toBeVisible();
|
||||
await expect(olderCard).toBeVisible();
|
||||
|
||||
// The newer entry should appear higher in the DOM (lower index)
|
||||
// The older entry should appear higher in the DOM (lower index)
|
||||
const newerIdx = await newerCard.evaluate(el => {
|
||||
return [...document.querySelectorAll('.journal-post')].findIndex(c => c.id === el.id);
|
||||
});
|
||||
@@ -39,36 +41,36 @@ test('T2: dailies shows newer entries before older entries', async ({ page }) =>
|
||||
return [...document.querySelectorAll('.journal-post')].findIndex(c => c.id === el.id);
|
||||
});
|
||||
|
||||
expect(newerIdx).toBeLessThan(olderIdx);
|
||||
expect(olderIdx).toBeLessThan(newerIdx);
|
||||
});
|
||||
|
||||
// ── T3: Individual entry page loads ───────────────────────────────────────────
|
||||
test('T3: individual entry page loads at /trips/italy-2026-demo/dailies/{slug}', async ({ page }) => {
|
||||
await page.goto(`/trips/italy-2026-demo/dailies/${KNOWN_SLUG}`);
|
||||
await expect(page.locator('article.entry')).toBeVisible();
|
||||
await expect(page.locator('article.journal-post')).toBeVisible();
|
||||
await expect(page.locator('.site-header')).toBeVisible();
|
||||
});
|
||||
|
||||
// ── T4: Entry page shows title, date, and content ─────────────────────────────
|
||||
test('T4: entry page shows title and body content', async ({ page }) => {
|
||||
await page.goto(`/trips/italy-2026-demo/dailies/${KNOWN_SLUG}`);
|
||||
await expect(page.locator('.entry-title')).toContainText(KNOWN_TITLE);
|
||||
await expect(page.locator('.entry-body')).not.toBeEmpty();
|
||||
await expect(page.locator('time.entry-date')).toBeVisible();
|
||||
await expect(page.locator('.journal-post-title')).toContainText(KNOWN_TITLE);
|
||||
await expect(page.locator('.journal-post-body')).not.toBeEmpty();
|
||||
await expect(page.locator('.journal-post-meta time')).toBeVisible();
|
||||
});
|
||||
|
||||
// ── T5: Entry page shows location when present ────────────────────────────────
|
||||
test('T5: entry page shows city and country when set', async ({ page }) => {
|
||||
await page.goto(`/trips/italy-2026-demo/dailies/${KNOWN_SLUG}`);
|
||||
await expect(page.locator('.entry-location')).toContainText(KNOWN_CITY);
|
||||
await expect(page.locator('.entry-location')).toContainText(KNOWN_COUNTRY);
|
||||
await expect(page.locator('.journal-post-location')).toContainText(KNOWN_CITY);
|
||||
await expect(page.locator('.journal-post-location')).toContainText(KNOWN_COUNTRY);
|
||||
});
|
||||
|
||||
// ── T6: Entry page has a fixed top back pill and a footer back pill ───────────────
|
||||
test('T6: entry page has fixed back pill at top and back pill in footer', async ({ page }) => {
|
||||
const KNOWN_ENTRY = `/trips/italy-2026-demo/dailies/${KNOWN_SLUG}`;
|
||||
await page.goto(KNOWN_ENTRY);
|
||||
await expect(page.locator('article.entry')).toBeVisible();
|
||||
await expect(page.locator('article.journal-post')).toBeVisible();
|
||||
const topPill = page.locator('.entry-back-fixed');
|
||||
await expect(topPill).toBeVisible();
|
||||
await expect(topPill).toHaveText(/← Back/);
|
||||
|
||||
Reference in New Issue
Block a user