mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-10-06 11:47:51 +00:00
test: capture settled artifact preview layouts
This commit is contained in:
parent
1644685867
commit
9a339df7a4
1 changed files with 21 additions and 0 deletions
|
|
@ -239,11 +239,32 @@ for (const kind of ['image', 'pdf', 'html'] as const) {
|
|||
await dialog.locator('.vk-overlay-scroll').evaluate((el) => {
|
||||
el.scrollTop = 0;
|
||||
});
|
||||
await dialog.evaluate(async (el) => {
|
||||
await Promise.all(
|
||||
el
|
||||
.getAnimations({ subtree: true })
|
||||
.map((animation) => animation.finished.catch(() => {}))
|
||||
);
|
||||
});
|
||||
await page.screenshot({ path: test.info().outputPath(`${kind}-preview.png`) });
|
||||
await page.setViewportSize({ width: 1700, height: 900 });
|
||||
await page.evaluate(() => {
|
||||
document.documentElement.style.fontSize = '16px';
|
||||
});
|
||||
await expect(dialog.getByRole('button', { name: 'Close dialog' })).toHaveCSS(
|
||||
'width',
|
||||
'34px'
|
||||
);
|
||||
await dialog.evaluate(async (el) => {
|
||||
await new Promise<void>((resolve) =>
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => resolve()))
|
||||
);
|
||||
await Promise.all(
|
||||
el
|
||||
.getAnimations({ subtree: true })
|
||||
.map((animation) => animation.finished.catch(() => {}))
|
||||
);
|
||||
});
|
||||
await page.screenshot({ path: test.info().outputPath(`${kind}-preview-large.png`) });
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(dialog).toHaveCount(0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue