From 5e954d8adfd01b4d14e758e7edbcede470b715ef Mon Sep 17 00:00:00 2001 From: Mischa Date: Fri, 19 Jun 2026 01:49:38 +0200 Subject: [PATCH] fix: update paths for trips/japan-korea-2026/dailies restructure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- Makefile | 16 +++++++++--- scripts/test-form-config.sh | 2 +- scripts/test-post.sh | 2 +- tests/ui/{tracker.spec.js => dailies.spec.js} | 22 ++++++++-------- tests/ui/helpers.js | 2 +- tests/ui/nav.spec.js | 26 +++++++++---------- tests/ui/post.spec.js | 8 +++--- 7 files changed, 44 insertions(+), 34 deletions(-) rename tests/ui/{tracker.spec.js => dailies.spec.js} (78%) diff --git a/Makefile b/Makefile index c53921c..c9c734f 100644 --- a/Makefile +++ b/Makefile @@ -40,14 +40,24 @@ install-plugins: # ── Demo content ────────────────────────────────────────────────────────────── demo-load: - cp -r user/docs/demo/tracker/. user/pages/01.tracker/ + # Load japan-korea-2026 dailies + cp -r user/docs/demo/trips/japan-korea-2026/dailies/. user/pages/01.trips/japan-korea-2026/01.dailies/ + # Load italy-2025 trip (create pages if absent) + mkdir -p user/pages/01.trips/italy-2025/01.dailies user/pages/01.trips/italy-2025/02.map user/pages/01.trips/italy-2025/03.stats user/pages/01.trips/italy-2025/04.stories + cp user/docs/demo/trips/italy-2025/trip.md user/pages/01.trips/italy-2025/trip.md 2>/dev/null || true + cp user/docs/demo/trips/italy-2025/map.md user/pages/01.trips/italy-2025/02.map/map.md 2>/dev/null || true + cp user/docs/demo/trips/italy-2025/stats.md user/pages/01.trips/italy-2025/03.stats/stats.md 2>/dev/null || true + cp user/docs/demo/trips/italy-2025/stories.md user/pages/01.trips/italy-2025/04.stories/stories.md 2>/dev/null || true + cp -r user/docs/demo/trips/italy-2025/dailies/. user/pages/01.trips/italy-2025/01.dailies/ + cp user/docs/demo/trips/italy-2025/*.gpx user/pages/01.trips/italy-2025/ 2>/dev/null || true docker exec intotheeast_grav bash -c "cd /var/www/html && php bin/grav clearcache" demo-reset: - @for dir in user/docs/demo/tracker/*/; do \ + @for dir in user/docs/demo/trips/japan-korea-2026/dailies/*/; do \ folder=$$(basename "$$dir"); \ - rm -rf "user/pages/01.tracker/$$folder"; \ + rm -rf "user/pages/01.trips/japan-korea-2026/01.dailies/$$folder"; \ done + rm -rf user/pages/01.trips/italy-2025 docker exec intotheeast_grav bash -c "cd /var/www/html && php bin/grav clearcache" # ── Content sync (user repo ↔ Gitea) ────────────────────────────────────────── diff --git a/scripts/test-form-config.sh b/scripts/test-form-config.sh index ca7f713..1f4f51c 100755 --- a/scripts/test-form-config.sh +++ b/scripts/test-form-config.sh @@ -26,7 +26,7 @@ grep -q "add_page:\|addpage:" "$FORM" && ok "Process action is 'add_page' (plugi # Config must be in frontmatter, not in the process block check_grep "pageconfig block exists in frontmatter" "^pageconfig:" -check_grep "parent set to /tracker" "parent: '/tracker'" +check_grep "parent set to /trips/japan-korea-2026/dailies" "parent: '/trips/japan-korea-2026/dailies'" check_grep "slug_field set (determines entry folder name)" "slug_field:" check_grep "pagefrontmatter block exists in frontmatter" "^pagefrontmatter:" check_grep "template: entry (creates entry.md filename)" "template: entry" diff --git a/scripts/test-post.sh b/scripts/test-post.sh index a6dfa05..0faed8f 100755 --- a/scripts/test-post.sh +++ b/scripts/test-post.sh @@ -7,7 +7,7 @@ set -euo pipefail BASE_URL="${GRAV_BASE_URL:-http://localhost:8081}" USER="${GRAV_TEST_USER:-}" PASS="${GRAV_TEST_PASS:-}" -TRACKER="user/pages/01.tracker" +TRACKER="user/pages/01.trips/japan-korea-2026/01.dailies" COOKIE_JAR="$(mktemp /tmp/grav-test-cookies.XXXXXX)" PASS_COUNT=0 FAIL_COUNT=0 diff --git a/tests/ui/tracker.spec.js b/tests/ui/dailies.spec.js similarity index 78% rename from tests/ui/tracker.spec.js rename to tests/ui/dailies.spec.js index 8f45d29..9ba75aa 100644 --- a/tests/ui/tracker.spec.js +++ b/tests/ui/dailies.spec.js @@ -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); }); diff --git a/tests/ui/helpers.js b/tests/ui/helpers.js index 891a376..78f504b 100644 --- a/tests/ui/helpers.js +++ b/tests/ui/helpers.js @@ -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. diff --git a/tests/ui/nav.spec.js b/tests/ui/nav.spec.js index 71af6b4..7d50fdf 100644 --- a/tests/ui/nav.spec.js +++ b/tests/ui/nav.spec.js @@ -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 ────────────────────────────────────────── diff --git a/tests/ui/post.spec.js b/tests/ui/post.spec.js index 1ac1129..af5b1df 100644 --- a/tests/ui/post.spec.js +++ b/tests/ui/post.spec.js @@ -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); });