test(post-form): assert post-success confirmation + view-journal CTA

This commit is contained in:
2026-07-04 19:23:44 +02:00
parent b3d3a8e8b8
commit ab5db71f35
+19
View File
@@ -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();
});