From ab5db71f3513412069846bacad386ce1a523455a Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 4 Jul 2026 19:23:44 +0200 Subject: [PATCH] test(post-form): assert post-success confirmation + view-journal CTA --- tests/ui/post/post-form-ux.spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/ui/post/post-form-ux.spec.js b/tests/ui/post/post-form-ux.spec.js index 38c7f2b..99616a2 100644 --- a/tests/ui/post/post-form-ux.spec.js +++ b/tests/ui/post/post-form-ux.spec.js @@ -101,3 +101,22 @@ test('R20: in-progress text is restored after a reload, with a photos hint', asy await page.evaluate((k) => localStorage.removeItem(k), DRAFT_KEY); }); + +// ── Success confirmation: after a post, show a clear CTA the owner can act on ── +test('post success shows a confirmation with a working "View your journal" link', async ({ page }) => { + const tag = `success-${Date.now()}`; + await page.goto('/post'); + await page.fill('input[name="data[title]"]', `UI Test ${tag}`); + await fillEditor(page, `success cta test ${tag}`); + await page.locator('.btn-post').evaluate(el => el.click()); + await expect(page.locator('.notices')).toContainText('Entry posted successfully!', { timeout: 15_000 }); + created.push(tag); + + const panel = page.locator('.post-success'); + await expect(panel).toBeVisible(); + const view = panel.locator('.post-success__view'); + await expect(view).toBeVisible(); + // links into the active trip's journal (resolved from site.active_trip) + await expect(view).toHaveAttribute('href', /\/trips\//); + await expect(panel.locator('.post-success__again')).toBeVisible(); +});