Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions web/tests/browser/typography.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,9 @@ test("spacing slider changes layout, persists, resets and retains touch targets
await expect(nav.locator("svg")).toHaveCSS("width", "21px");
await page.setViewportSize({ width: 320, height: 800 });
await page.addStyleTag({ content: "html { font-size: 200%; }" });
await page.locator(".route-stage").evaluate(async (element) => {
await Promise.all(element.getAnimations().map((animation) => animation.finished));
});
const overflow = await page.evaluate(() => Array.from(document.querySelectorAll("*"))
// WebKit can report no active route animation before its first paint.
// Check the settled layout instead of sampling that transient entry frame.
await expect.poll(() => page.evaluate(() => Array.from(document.querySelectorAll("*"))
.map((element) => {
const rect = element.getBoundingClientRect();
return {
Expand All @@ -270,8 +269,7 @@ test("spacing slider changes layout, persists, resets and retains touch targets
right: Math.round(rect.right),
};
})
.filter((item) => item.right > innerWidth + 1 || item.left < -1));
expect(overflow).toEqual([]);
.filter((item) => item.right > innerWidth + 1 || item.left < -1))).toEqual([]);
expect((await slider.boundingBox())!.height).toBeGreaterThanOrEqual(48);
await slider.screenshot({
path: `output/playwright/${info.project.name}-spacing-${value}.png`,
Expand Down
Loading