diff --git a/tests/kicad/presence-stale-after-delete.spec.ts b/tests/kicad/presence-stale-after-delete.spec.ts index 562438c..0c57835 100644 --- a/tests/kicad/presence-stale-after-delete.spec.ts +++ b/tests/kicad/presence-stale-after-delete.spec.ts @@ -166,14 +166,16 @@ for (const kind of ["selection", "xsel"] as const) { // WIRE1 is deleted through a real SCH_COMMIT — the same path a remote // apply (peer deleted it) or a local menu delete takes. expect(await removeItem(page, WIRE1)).toBe(true); - await page.waitForTimeout(1500); + // Documented interaction dwell: the overlay repaint has no observable signal + // — settledShot below compares stable frames, this only lets it queue. + await page.waitForTimeout(1500); // eslint-disable-line -- documented interaction dwell const afterDelete = await settledShot(canvas); // Ground truth for "what the overlay should look like now": force the // overlay to rebuild from the SAME peer snapshot — WIRE1 no longer // resolves, so nothing is drawn for it. await setRemote(page, { peers: [peer] }); - await page.waitForTimeout(1500); + await page.waitForTimeout(1500); // eslint-disable-line -- documented interaction dwell (overlay rebuild, no observable) const afterRepush = await settledShot(canvas); expect( @@ -223,7 +225,7 @@ test("local emit: keyboard Delete on the canvas does publish the empty selection // Give the wx canvas keyboard focus with a click on empty sheet space (this // clears any selection — the programmatic select comes after). await page.mouse.click(box!.x + box!.width * 0.5, box!.y + box!.height * 0.95); - await page.locator("#canvas").focus().catch(() => {}); + await page.locator("#canvas").focus().catch(() => {}); // documented best-effort: wx canvas may reject DOM focus after the click already focused it const id = await page.evaluate(() => (window as unknown as W).Module.kicadCollabTestSelectFirst(), ); diff --git a/tests/web/presence-ghost-diag.spec.ts b/tests/web/presence-ghost-diag.spec.ts index 5771927..ab139d5 100644 --- a/tests/web/presence-ghost-diag.spec.ts +++ b/tests/web/presence-ghost-diag.spec.ts @@ -88,7 +88,7 @@ for (const close of [true, false]) test(`diag: what bob receives after alice ${c const before = await bob.evaluate((since) => (window as any).__awLog.filter((e: any) => e.type === 1 && e.t < since).flatMap((e: any) => e.ents.map((x: any) => `${new Date(e.t).toISOString().slice(14, 19)} ch${e.ch} cid=${x.cid} clk=${x.clk} ${x.user}`)), tCut); console.log(`[diag] bob inbound awareness BEFORE cut (last 12):\n ${before.slice(-12).join('\n ')}`); for (let i = 1; i <= 4; i++) { - await bob.waitForTimeout(10000); + await bob.waitForTimeout(10000); // eslint-disable-line -- documented sampling dwell: diag probe cadence inside an explicit loop const present = await bob.locator('[data-presence-user="alice"]').count(); const aliceWs = await alice.evaluate(() => (window as any).__wsList.map((w: any) => ({ url: w.url.slice(0, 60), state: w.ws.readyState, t: w.t }))); const log = await bob.evaluate((since) => (window as any).__awLog.filter((e: any) => e.t >= since), tCut); diff --git a/tests/web/presence-ghost-peer.spec.ts b/tests/web/presence-ghost-peer.spec.ts index e2b045f..405cc1a 100644 --- a/tests/web/presence-ghost-peer.spec.ts +++ b/tests/web/presence-ghost-peer.spec.ts @@ -106,7 +106,7 @@ for (const mode of ['half-open', 'unclean-close'] as const) { const present = await bob.locator('[data-presence-user="alice"]').count(); seen.push(`+${Math.round((Date.now() - t0) / 1000)}s:${present}`); if (present === 0) { ms = Date.now() - t0; break; } - await bob.waitForTimeout(5000); + await bob.waitForTimeout(5000); // eslint-disable-line -- documented sampling dwell: presence-eviction probe cadence inside an explicit bounded loop } const sockets = await alice.evaluate(() => (window as unknown as { __wsReport(): unknown }).__wsReport()); // eslint-disable-next-line no-console