diff --git a/lib/host/playwright/relate-picker.spec.js b/lib/host/playwright/relate-picker.spec.js index a53799ea..d00ce1b1 100644 --- a/lib/host/playwright/relate-picker.spec.js +++ b/lib/host/playwright/relate-picker.spec.js @@ -97,6 +97,25 @@ test.describe('relate picker', () => { await expect(page.locator('body')).toContainText('Picker Item 07'); }); + test('the remove button on a current relation actually unrelates it', async ({ page }) => { + test.setTimeout(75000); + await loginTo(page, `/${HOST}/edit`); + await waitReady(page); + // relate Item 13 via the picker, then reload so it shows in the current list + await page.fill(RELF, 'Item 13'); + await expect.poll(() => page.locator(RELROWS).count(), { timeout: 10000 }).toBe(1); + await page.locator(`${RELROWS} button`).first().click(); + await expect.poll(() => page.locator(RELROWS).count(), { timeout: 10000 }).toBe(0); + await page.reload(); + await waitReady(page); + const relLink = page.locator('a[href="/picker-item-13/"]'); + await expect(relLink).toHaveCount(1); // current relation present + // click its remove button — a plain boosted form (regression: this did nothing + // because bind-boost-form discarded the form's method/action) + await page.locator('li:has(a[href="/picker-item-13/"]) button').click(); + await expect(relLink).toHaveCount(0, { timeout: 12000 }); // relation removed + }); + test('picker populates after a boosted SPA nav to the edit page', async ({ page }) => { // Reach the edit page by CLICKING its link (a boosted SPA nav), not page.goto. // The old inline