From 256542da418027670652b8b8b4b96a17a3e2cd35 Mon Sep 17 00:00:00 2001 From: Cameron Hotchkies Date: Thu, 16 Jul 2026 20:31:45 -0700 Subject: [PATCH] fix(e2e): replace flaky frame-count assertion with stable height check (#2011) Signed-off-by: Cameron Hotchkies Co-authored-by: npub1cn4wxjqpz52r62hvt88u2kfxvlkpy3dvqdu7sagdzd6fwdahlz0q24c648 --- desktop/tests/e2e/agents.spec.ts | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/desktop/tests/e2e/agents.spec.ts b/desktop/tests/e2e/agents.spec.ts index 21ca0bd349..c37d4eb7d8 100644 --- a/desktop/tests/e2e/agents.spec.ts +++ b/desktop/tests/e2e/agents.spec.ts @@ -1121,25 +1121,9 @@ test("share access controls include the selected memories", async ({ .getByRole("menuitemradio", { name: "Agent + core memory" }) .click(); await expect(linkAccess).toHaveText("Agent + core memory"); - const shareCardHeightSamples = await shareMainCard.evaluate( - async (element) => { - const samples: number[] = []; - const start = performance.now(); - - await new Promise((resolve) => { - const sample = (now: number) => { - samples.push(element.getBoundingClientRect().height); - if (now - start >= 280) { - resolve(); - return; - } - requestAnimationFrame(sample); - }; - requestAnimationFrame(sample); - }); - - return samples; - }, + await waitForAnimations(page); + const expandedShareCardHeight = await shareMainCard.evaluate( + (element) => element.getBoundingClientRect().height, ); const inlineMemoryWarning = shareDialog.getByTestId( "persona-share-memory-warning", @@ -1151,10 +1135,7 @@ test("share access controls include the selected memories", async ({ await expect(inlineMemoryWarning).toContainText( "Only share it with people you trust.", ); - expect(shareCardHeightSamples.at(-1)).toBeGreaterThan(initialShareCardHeight); - expect( - new Set(shareCardHeightSamples.map((height) => Math.round(height))).size, - ).toBeGreaterThan(2); + expect(expandedShareCardHeight).toBeGreaterThan(initialShareCardHeight); await page.getByTestId("persona-share-copy-link").click(); const memoryConfirmation = page.getByTestId( "persona-share-memory-confirmation",