diff --git a/tests/playwright/demo-interactions.spec.js b/tests/playwright/demo-interactions.spec.js index 43229ca8..550d2cca 100644 --- a/tests/playwright/demo-interactions.spec.js +++ b/tests/playwright/demo-interactions.spec.js @@ -203,7 +203,7 @@ test.describe('Marshes interactions', () => { if (await btn.count() > 0) { const textBefore = await el.textContent(); await btn.click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(4000); expect(await el.textContent()).not.toBe(textBefore); } await assertNoClassLeak(page, '[data-sx-island*="marsh-settle"]'); @@ -215,18 +215,33 @@ test.describe('Marshes interactions', () => { const reader = island(page, 'marsh-store-reader'); await expect(writer).toBeVisible({ timeout: 10000 }); await expect(reader).toBeVisible({ timeout: 10000 }); + // Click a price button and verify cross-island signal propagation + const priceBtn = writer.locator('button').first(); + if (await priceBtn.count() > 0) { + const readerBefore = await reader.textContent(); + await priceBtn.click(); + await page.waitForTimeout(500); + const readerAfter = await reader.textContent(); + expect(readerAfter).not.toBe(readerBefore); + } }); test('view-transform: view toggle changes rendering', async ({ page }) => { await loadPage(page, '(geography.(marshes.view-transform))'); const el = island(page, 'marsh-view-transform'); await expect(el).toBeVisible({ timeout: 10000 }); + // Fetch catalog first — view toggle only changes rendering of loaded items + const fetchBtn = el.locator('button:has-text("Fetch Catalog")'); + if (await fetchBtn.count() > 0) { + await fetchBtn.click(); + await page.waitForTimeout(4000); + } const viewBtns = el.locator('button'); if (await viewBtns.count() >= 2) { - const htmlBefore = await el.innerHTML(); + const textBefore = await el.textContent(); await viewBtns.nth(1).click(); - await page.waitForTimeout(300); - expect(await el.innerHTML()).not.toBe(htmlBefore); + await page.waitForTimeout(500); + expect(await el.textContent()).not.toBe(textBefore); } }); });