fix: update paths for trips/japan-korea-2026/dailies restructure
- Update post form parent, Makefile demo targets, and test scripts to use new trip-scoped paths (01.trips/japan-korea-2026/01.dailies) - Rename tracker.spec.js → dailies.spec.js and update all /tracker URLs to /trips/japan-korea-2026/dailies across nav.spec.js, post.spec.js, helpers.js, and dailies.spec.js - Add Italy 2025 demo trip to Makefile demo-load/demo-reset targets Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// @ts-check
|
||||
// Tests: T1–T5 — tracker feed and individual entry pages
|
||||
// Tests: T1–T5 — dailies feed and individual entry pages
|
||||
const { test, expect } = require('@playwright/test');
|
||||
|
||||
// Known fixture entries that always exist in the repo
|
||||
@@ -12,18 +12,18 @@ const KNOWN_COUNTRY = 'Japan';
|
||||
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)
|
||||
|
||||
// ── T1: Tracker page loads ─────────────────────────────────────────────────────
|
||||
test('T1: /tracker loads and shows at least one entry card', async ({ page }) => {
|
||||
await page.goto('/tracker');
|
||||
// ── 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('.site-header')).toBeVisible();
|
||||
});
|
||||
|
||||
// ── T2: Entries are newest-first ──────────────────────────────────────────────
|
||||
// Verify using two known fixture entries rather than all entries
|
||||
// (the tracker may contain noisy test-run debris with inconsistent dates).
|
||||
test('T2: tracker shows newer entries before older entries', async ({ page }) => {
|
||||
await page.goto('/tracker');
|
||||
// (the dailies may contain noisy test-run debris with inconsistent dates).
|
||||
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 a[href*="${NEWER_SLUG}"]`);
|
||||
@@ -44,15 +44,15 @@ test('T2: tracker shows newer entries before older entries', async ({ page }) =>
|
||||
});
|
||||
|
||||
// ── T3: Individual entry page loads ───────────────────────────────────────────
|
||||
test('T3: individual entry page loads at /tracker/{slug}', async ({ page }) => {
|
||||
await page.goto(`/tracker/${KNOWN_SLUG}`);
|
||||
test('T3: individual entry page loads at /trips/japan-korea-2026/dailies/{slug}', async ({ page }) => {
|
||||
await page.goto(`/trips/japan-korea-2026/dailies/${KNOWN_SLUG}`);
|
||||
await expect(page.locator('article.entry')).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(`/tracker/${KNOWN_SLUG}`);
|
||||
await page.goto(`/trips/japan-korea-2026/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();
|
||||
@@ -60,7 +60,7 @@ test('T4: entry page shows title and body content', async ({ page }) => {
|
||||
|
||||
// ── T5: Entry page shows location when present ────────────────────────────────
|
||||
test('T5: entry page shows city and country when set', async ({ page }) => {
|
||||
await page.goto(`/tracker/${KNOWN_SLUG}`);
|
||||
await page.goto(`/trips/japan-korea-2026/dailies/${KNOWN_SLUG}`);
|
||||
await expect(page.locator('.entry-location')).toContainText(KNOWN_CITY);
|
||||
await expect(page.locator('.entry-location')).toContainText(KNOWN_COUNTRY);
|
||||
});
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const TRACKER_DIR = path.join(__dirname, '../../user/pages/01.tracker');
|
||||
const TRACKER_DIR = path.join(__dirname, '../../user/pages/01.trips/japan-korea-2026/01.dailies');
|
||||
|
||||
/**
|
||||
* Wait for all filepond items to finish XHR upload.
|
||||
|
||||
+13
-13
@@ -2,42 +2,42 @@
|
||||
// Tests: N1–N5 — page loads and navigation links
|
||||
const { test, expect } = require('@playwright/test');
|
||||
|
||||
// ── N1: /tracker renders ──────────────────────────────────────────────────────
|
||||
test('N1: /tracker page loads with site header', async ({ page }) => {
|
||||
// ── N1: /trips/japan-korea-2026/dailies renders ───────────────────────────────
|
||||
test('N1: /trips/japan-korea-2026/dailies page loads with site header', async ({ page }) => {
|
||||
const errors = [];
|
||||
page.on('pageerror', e => errors.push(e.message));
|
||||
|
||||
await page.goto('/tracker');
|
||||
await page.goto('/trips/japan-korea-2026/dailies');
|
||||
await expect(page.locator('.site-header')).toBeVisible();
|
||||
await expect(page).toHaveTitle(/Into the East/i);
|
||||
expect(errors).toHaveLength(0);
|
||||
});
|
||||
|
||||
// ── N2: /map renders without JS errors ───────────────────────────────────────
|
||||
test('N2: /map page loads without JS errors', async ({ page }) => {
|
||||
// ── N2: /trips/japan-korea-2026/map renders without JS errors ─────────────────
|
||||
test('N2: /trips/japan-korea-2026/map page loads without JS errors', async ({ page }) => {
|
||||
const errors = [];
|
||||
page.on('pageerror', e => errors.push(e.message));
|
||||
|
||||
await page.goto('/map');
|
||||
await page.goto('/trips/japan-korea-2026/map');
|
||||
await expect(page.locator('.site-header')).toBeVisible();
|
||||
expect(errors).toHaveLength(0);
|
||||
});
|
||||
|
||||
// ── N3: /stats renders ───────────────────────────────────────────────────────
|
||||
test('N3: /stats page loads with site header', async ({ page }) => {
|
||||
// ── N3: /trips/japan-korea-2026/stats renders ─────────────────────────────────
|
||||
test('N3: /trips/japan-korea-2026/stats page loads with site header', async ({ page }) => {
|
||||
const errors = [];
|
||||
page.on('pageerror', e => errors.push(e.message));
|
||||
|
||||
await page.goto('/stats');
|
||||
await page.goto('/trips/japan-korea-2026/stats');
|
||||
await expect(page.locator('.site-header')).toBeVisible();
|
||||
expect(errors).toHaveLength(0);
|
||||
});
|
||||
|
||||
// ── N4: "Journal" nav link goes to /tracker ───────────────────────────────────
|
||||
test('N4: Journal nav link navigates to /tracker', async ({ page }) => {
|
||||
// ── N4: "Journal" nav link goes to /dailies ───────────────────────────────────
|
||||
test('N4: Journal nav link navigates to /dailies', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.click('nav a[href*="tracker"]');
|
||||
await expect(page).toHaveURL(/\/tracker/);
|
||||
await page.click('nav a[href*="dailies"]');
|
||||
await expect(page).toHaveURL(/\/dailies/);
|
||||
});
|
||||
|
||||
// ── N5: "Map" nav link goes to /map ──────────────────────────────────────────
|
||||
|
||||
@@ -16,7 +16,7 @@ test.afterAll(() => {
|
||||
});
|
||||
|
||||
// ── P1: Post without photo ─────────────────────────────────────────────────────
|
||||
test('P1: post text-only entry → created on disk and visible on /tracker', async ({ page }) => {
|
||||
test('P1: post text-only entry → created on disk and visible on /dailies', async ({ page }) => {
|
||||
const tag = `p1-${Date.now()}`;
|
||||
const title = `UI Test ${tag}`;
|
||||
|
||||
@@ -39,12 +39,12 @@ test('P1: post text-only entry → created on disk and visible on /tracker', asy
|
||||
const photos = fs.readdirSync(entryDir).filter(f => /\.(jpg|jpeg|png|webp|heic)$/i.test(f));
|
||||
expect(photos.length, 'Text-only entry should have no photos').toBe(0);
|
||||
|
||||
await page.goto('/tracker');
|
||||
await page.goto('/trips/japan-korea-2026/dailies');
|
||||
await expect(page.locator('body')).toContainText(tag);
|
||||
});
|
||||
|
||||
// ── P2: Post with photo ────────────────────────────────────────────────────────
|
||||
test('P2: post entry with photo → photo saved in entry folder and visible on /tracker', async ({ page }) => {
|
||||
test('P2: post entry with photo → photo saved in entry folder and visible on /dailies', async ({ page }) => {
|
||||
const tag = `p2-${Date.now()}`;
|
||||
const title = `UI Test ${tag}`;
|
||||
|
||||
@@ -70,7 +70,7 @@ test('P2: post entry with photo → photo saved in entry folder and visible on /
|
||||
const photos = fs.readdirSync(entryDir).filter(f => /\.(jpg|jpeg|png|webp|heic)$/i.test(f));
|
||||
expect(photos.length, 'At least one photo should be saved').toBeGreaterThan(0);
|
||||
|
||||
await page.goto('/tracker');
|
||||
await page.goto('/trips/japan-korea-2026/dailies');
|
||||
await expect(page.locator('body')).toContainText(tag);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user