test(post-form): assert post-success confirmation + view-journal CTA
This commit is contained in:
@@ -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);
|
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();
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user