Fix 5 Playwright marshes test failures: timing + test logic
on-settle: increase wait from 2s to 4s — server fetch + settle hook needs more time than the original timeout allowed. server-signals: add actual cross-island signal test — click a price button in writer island and verify reader island updates. view-transform: fetch catalog before toggling view — the view toggle only changes rendering of loaded items, not the empty state. All 19 demo-interaction tests pass (was 14/19). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -203,7 +203,7 @@ test.describe('Marshes interactions', () => {
|
|||||||
if (await btn.count() > 0) {
|
if (await btn.count() > 0) {
|
||||||
const textBefore = await el.textContent();
|
const textBefore = await el.textContent();
|
||||||
await btn.click();
|
await btn.click();
|
||||||
await page.waitForTimeout(2000);
|
await page.waitForTimeout(4000);
|
||||||
expect(await el.textContent()).not.toBe(textBefore);
|
expect(await el.textContent()).not.toBe(textBefore);
|
||||||
}
|
}
|
||||||
await assertNoClassLeak(page, '[data-sx-island*="marsh-settle"]');
|
await assertNoClassLeak(page, '[data-sx-island*="marsh-settle"]');
|
||||||
@@ -215,18 +215,33 @@ test.describe('Marshes interactions', () => {
|
|||||||
const reader = island(page, 'marsh-store-reader');
|
const reader = island(page, 'marsh-store-reader');
|
||||||
await expect(writer).toBeVisible({ timeout: 10000 });
|
await expect(writer).toBeVisible({ timeout: 10000 });
|
||||||
await expect(reader).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 }) => {
|
test('view-transform: view toggle changes rendering', async ({ page }) => {
|
||||||
await loadPage(page, '(geography.(marshes.view-transform))');
|
await loadPage(page, '(geography.(marshes.view-transform))');
|
||||||
const el = island(page, 'marsh-view-transform');
|
const el = island(page, 'marsh-view-transform');
|
||||||
await expect(el).toBeVisible({ timeout: 10000 });
|
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');
|
const viewBtns = el.locator('button');
|
||||||
if (await viewBtns.count() >= 2) {
|
if (await viewBtns.count() >= 2) {
|
||||||
const htmlBefore = await el.innerHTML();
|
const textBefore = await el.textContent();
|
||||||
await viewBtns.nth(1).click();
|
await viewBtns.nth(1).click();
|
||||||
await page.waitForTimeout(300);
|
await page.waitForTimeout(500);
|
||||||
expect(await el.innerHTML()).not.toBe(htmlBefore);
|
expect(await el.textContent()).not.toBe(textBefore);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user