From d19a5802aee9ab6c755122d1156594f40598c319 Mon Sep 17 00:00:00 2001 From: Mischa Date: Sat, 4 Jul 2026 19:47:00 +0200 Subject: [PATCH] test(post-form): assert photo section auto-collapse + summary bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Retarget AE1's completed-item assertion (the item is now hidden once the section auto-collapses) to the "✓ N photo ready" summary, and add a spec covering collapse-after-upload + re-expand on tap. Co-Authored-By: Claude Opus 4.8 --- tests/ui/post/post-form-ux.spec.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/ui/post/post-form-ux.spec.js b/tests/ui/post/post-form-ux.spec.js index 99616a2..1122676 100644 --- a/tests/ui/post/post-form-ux.spec.js +++ b/tests/ui/post/post-form-ux.spec.js @@ -33,7 +33,8 @@ test('AE1: a HEIC photo is converted to JPEG client-side and posted', async ({ p await page.locator('input.filepond--browser').setInputFiles(TEST_HEIC); await waitForPhotoUpload(page, 1); // converted (beforeAddFile) + uploaded via FilePond - await expect(page.locator('.filepond--item[data-filepond-item-state="processing-complete"]')).toBeVisible(); + // The photo section auto-collapses to a summary bar once the upload settles. + await expect(page.locator('.photos-collapse__summary')).toContainText('1 photo ready'); await page.locator('.btn-post').evaluate(el => el.click()); await expect(page.locator('.notices')).toContainText('Entry posted successfully!', { timeout: 15_000 }); @@ -68,6 +69,24 @@ test('AE4: a corrupt HEIC is blocked (fail-closed) and never posted', async ({ p expect(files.some(f => /\.heic$/i.test(f)), 'the corrupt HEIC must never be posted').toBe(false); }); +// ── Photo section collapses to a summary after upload, re-expands on tap ────── +test('photo section auto-collapses to a summary after upload and re-expands on tap', async ({ page }) => { + await page.goto('/post'); + const details = page.locator('details.photos-collapse'); + await expect(details).toHaveJSProperty('open', true); // open while empty + + await page.locator('input.filepond--browser').setInputFiles(TEST_HEIC); + await waitForPhotoUpload(page, 1); + + // Settled → auto-collapsed, summary reflects the ready count. + await expect(details).toHaveJSProperty('open', false); + await expect(page.locator('.photos-collapse__summary')).toContainText('1 photo ready'); + + // Native
: clicking the summary re-expands for review. + await page.locator('.photos-collapse__summary').click(); + await expect(details).toHaveJSProperty('open', true); +}); + // ── R18: Get Weather is gated on coordinates ────────────────────────────────── test('R18: Get Weather is disabled until Get Location provides coordinates', async ({ page, context }) => { await context.grantPermissions(['geolocation']);