diff --git a/tests/ui/trip/trip-header.spec.js b/tests/ui/trip/trip-header.spec.js index 2f25ca8..047bc0c 100644 --- a/tests/ui/trip/trip-header.spec.js +++ b/tests/ui/trip/trip-header.spec.js @@ -36,6 +36,11 @@ test('U4/R13: description is clamped to a preview and expands to full text', asy await expect(desc).toHaveAttribute('data-collapsed', 'true'); await expect(btn).toBeVisible(); + // Collapsed: the body is genuinely clamped — visible height is shorter than + // its full content (the max-height:4.8em preview actually hides overflow). + const clampedWhenCollapsed = await body.evaluate((el) => el.clientHeight < el.scrollHeight); + expect(clampedWhenCollapsed).toBe(true); + const collapsedH = (await body.boundingBox()).height; await btn.click(); @@ -43,7 +48,10 @@ test('U4/R13: description is clamped to a preview and expands to full text', asy await expect(btn).toHaveText('Show less'); const expandedH = (await body.boundingBox()).height; expect(expandedH).toBeGreaterThan(collapsedH); - await expect(body).toContainText('finally made sense'); // tail of the full description + // Expanded: the clamp is gone — the full text is now actually visible, not + // merely present in the DOM (which it was even while collapsed). + const unclampedWhenExpanded = await body.evaluate((el) => el.clientHeight >= el.scrollHeight - 1); + expect(unclampedWhenExpanded).toBe(true); }); // ── R9/AE3: banner uses the first journal image (no cover_image set) ─────────── diff --git a/tests/ui/trip/trips-list.spec.js b/tests/ui/trip/trips-list.spec.js index 83cd161..1d72518 100644 --- a/tests/ui/trip/trips-list.spec.js +++ b/tests/ui/trip/trips-list.spec.js @@ -1,5 +1,8 @@ // @ts-check -// Tests: U3 — trip-list card one-liner + retina cover (R5, R6, R7, R11, R14) +// Tests: U3 — trip-list card one-liner + retina cover (R5, R6, R7, R14) +// R11 (set-but-unresolvable cover_image falls back) shares the exact else-branch +// exercised by the R7/AE3 fallback test below; it is covered by construction in +// the shared cover macro rather than by a dedicated fixture here. const { test, expect } = require('@playwright/test'); const DEMO_HREF = '/trips/italy-2026-demo'; // has a tagline, no cover_image (entry-image fallback)