mirror of
https://github.com/vector-im/element-call.git
synced 2026-05-01 09:54:37 +00:00
fix: wrong usage of poll
This commit is contained in:
@@ -127,23 +127,19 @@ async function expectVideoTilesCount(page: Page, count: number): Promise<void> {
|
||||
// There should be `count` video elements, visible and autoplaying
|
||||
await expect(page.locator("video")).toHaveCount(count);
|
||||
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
return await page
|
||||
.locator("video")
|
||||
.evaluateAll(
|
||||
(videos: Element[]) =>
|
||||
videos.filter(
|
||||
(v: Element) => window.getComputedStyle(v).display === "block",
|
||||
).length,
|
||||
);
|
||||
},
|
||||
{
|
||||
timeout: 10000,
|
||||
},
|
||||
)
|
||||
.toBe(count);
|
||||
await expect(async () => {
|
||||
const videoBlockCount = await page
|
||||
.locator("video")
|
||||
.evaluateAll(
|
||||
(videos: Element[]) =>
|
||||
videos.filter(
|
||||
(v: Element) => window.getComputedStyle(v).display === "block",
|
||||
).length,
|
||||
);
|
||||
expect(videoBlockCount).toBe(count);
|
||||
}).toPass({
|
||||
timeout: 10000,
|
||||
});
|
||||
}
|
||||
|
||||
export const SpaHelpers = {
|
||||
|
||||
Reference in New Issue
Block a user