mirror of
https://github.com/block/buzz.git
synced 2026-10-30 22:11:36 +00:00
fix(e2e): replace flaky frame-count assertion with stable height check (#2011)
Signed-off-by: Cameron Hotchkies <chotchkies@block.xyz> Co-authored-by: npub1cn4wxjqpz52r62hvt88u2kfxvlkpy3dvqdu7sagdzd6fwdahlz0q24c648 <c4eae3480115143d2aec59cfc5592667ec1245ac0379e8750d13749737b7f89e@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
committed by
GitHub
parent
76298a5e2b
commit
256542da41
@@ -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<void>((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",
|
||||
|
||||
Reference in New Issue
Block a user