From 83788d1838948910f1e7d8c4dafe8630261031d5 Mon Sep 17 00:00:00 2001 From: Kelly Joseph Price Date: Thu, 7 Mar 2024 11:33:25 -0800 Subject: [PATCH] test: try sleeping too? --- __tests__/browser/markdown.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/__tests__/browser/markdown.test.js b/__tests__/browser/markdown.test.js index 4f1872bb4..b896f2a90 100644 --- a/__tests__/browser/markdown.test.js +++ b/__tests__/browser/markdown.test.js @@ -1,6 +1,7 @@ /* global page */ -// const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); +// eslint-disable-next-line no-promise-executor-return +const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); describe('visual regression tests', () => { describe('rdmd syntax', () => { @@ -33,6 +34,7 @@ describe('visual regression tests', () => { await page.evaluate(() => { window.scrollTo(0, window.document.body.scrollHeight); }); + await sleep(500); const image = await page.screenshot({ fullPage: true }); @@ -47,6 +49,7 @@ describe('visual regression tests', () => { await page.evaluate(() => { window.scrollTo(0, window.document.body.scrollHeight); }); + await sleep(500); const image = await page.screenshot({ fullPage: true }); @@ -59,6 +62,7 @@ describe('visual regression tests', () => { await page.evaluate(() => { window.scrollTo(0, window.document.body.scrollHeight); }); + await sleep(500); const image = await page.screenshot({ fullPage: true });