Skip to content

Commit 549c5c2

Browse files
committed
update screenshot
1 parent 4e4afa2 commit 549c5c2

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

test/puppeteer-environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ try {
4545
typeof NodeEnvironmentClass
4646
);
4747
// Last resort fallback - use dynamic import to avoid linter warning
48-
// eslint-disable-next-line global-require
48+
// eslint-disable-next-line no-new-func
4949
const fallbackEnv = Function('return require("jest-environment-node")')();
5050
NodeEnvironmentClass = fallbackEnv.default || fallbackEnv;
5151
}

test/utils/open-addon.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
export const openAddon = async (page) => {
22
await page.goto(process.env.SHEET_URL);
33

4-
await page.waitForTimeout(5000); // pause for 5 seconds
4+
await page.waitForTimeout(7000); // pause for 5 seconds
5+
6+
// Create directory for screenshots if it doesn't exist
7+
const fs = await import('fs');
8+
const path = await import('path');
9+
const screenshotDir = 'test/__image_snapshots__/__diff_output__';
10+
if (!fs.existsSync(screenshotDir)) {
11+
fs.mkdirSync(screenshotDir, { recursive: true });
12+
}
13+
514
// take screenshot
615
await page.screenshot({
7-
path: 'test/__image_snapshots__/__diff_output__/main-spreadsheet-page.png',
16+
path: path.join(screenshotDir, 'main-spreadsheet-page.png'),
817
});
918
await page.click('a:nth-child(2)'); // click on signin button
1019

0 commit comments

Comments
 (0)