test(post-form): realign photo specs to FilePond after U4 rework

waitForPhotoUpload waits on FilePond processing-complete; AE1/AE4 use
input.filepond--browser + the .photo-convert-status error status; V3/V4 back
to FilePond limit + non-image rejection; reauth hint -> .photo-reauth-hint;
test-form-config asserts type:filepond. Verified against a live server via a
browser smoke run (HEIC->JPEG attach, corrupt fail-closed, draft restore).
This commit is contained in:
2026-07-04 17:52:09 +02:00
parent 421c21345e
commit 27a35a1db8
5 changed files with 42 additions and 31 deletions
+7 -6
View File
@@ -31,9 +31,9 @@ test('AE1: a HEIC photo is converted to JPEG client-side and posted', async ({ p
await page.fill('input[name="data[title]"]', `UI Test ${tag}`);
await fillEditor(page, 'HEIC conversion test. Safe to delete.');
await page.locator('input.photo-picker__input').setInputFiles(TEST_HEIC);
await waitForPhotoUpload(page, 1); // is-done == converted + uploaded
await expect(page.locator('.photo-card.is-done .photo-card__thumb')).toBeVisible();
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();
await page.locator('.btn-post').evaluate(el => el.click());
await expect(page.locator('.notices')).toContainText('Entry posted successfully!', { timeout: 15_000 });
@@ -53,8 +53,9 @@ test('AE4: a corrupt HEIC is blocked (fail-closed) and never posted', async ({ p
await page.fill('input[name="data[title]"]', `UI Test ${tag}`);
await fillEditor(page, 'HEIC failure test. Safe to delete.');
await page.locator('input.photo-picker__input').setInputFiles(TEST_CORRUPT_HEIC);
await expect(page.locator('.photo-card.is-error')).toBeVisible({ timeout: 15_000 });
await page.locator('input.filepond--browser').setInputFiles(TEST_CORRUPT_HEIC);
// Conversion fails → inline error status, original HEIC never added to FilePond.
await expect(page.locator('.photo-convert-status.form-status--err')).toBeVisible({ timeout: 15_000 });
await expect(page.locator('.btn-post')).toBeEnabled(); // Submit still usable
await page.locator('.btn-post').evaluate(el => el.click());
@@ -96,7 +97,7 @@ test('R20: in-progress text is restored after a reload, with a photos hint', asy
await expect(page.locator('input[name="data[title]"]')).toHaveValue(marker);
expect(await page.evaluate(() => window.postFormEditor.value())).toContain(marker);
await expect(page.locator('.photo-picker__reauth-hint')).toBeVisible();
await expect(page.locator('.photo-reauth-hint')).toBeVisible();
await page.evaluate((k) => localStorage.removeItem(k), DRAFT_KEY);
});