fix: wrong usage of poll

This commit is contained in:
Valere
2026-04-24 11:24:00 +02:00
parent 6317a06472
commit ca305b9da1
+5 -9
View File
@@ -127,10 +127,8 @@ async function expectVideoTilesCount(page: Page, count: number): Promise<void> {
// There should be `count` video elements, visible and autoplaying // There should be `count` video elements, visible and autoplaying
await expect(page.locator("video")).toHaveCount(count); await expect(page.locator("video")).toHaveCount(count);
await expect await expect(async () => {
.poll( const videoBlockCount = await page
async () => {
return await page
.locator("video") .locator("video")
.evaluateAll( .evaluateAll(
(videos: Element[]) => (videos: Element[]) =>
@@ -138,12 +136,10 @@ async function expectVideoTilesCount(page: Page, count: number): Promise<void> {
(v: Element) => window.getComputedStyle(v).display === "block", (v: Element) => window.getComputedStyle(v).display === "block",
).length, ).length,
); );
}, expect(videoBlockCount).toBe(count);
{ }).toPass({
timeout: 10000, timeout: 10000,
}, });
)
.toBe(count);
} }
export const SpaHelpers = { export const SpaHelpers = {