Skip to content

Commit

Permalink
test: disable timeout for puppeteer waitForSelector (ant-design#44611)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Sep 4, 2023
1 parent 56724cd commit 54316f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,9 @@
"@types/jest-image-snapshot": "^6.1.0",
"@types/jquery": "^3.5.14",
"@types/lodash": "^4.14.139",
"@types/lz-string": "^1.3.34",
"@types/node": "^20.0.0",
"@types/prismjs": "^1.26.0",
"@types/progress": "^2.0.5",
"@types/puppeteer": "^7.0.4",
"@types/qs": "^6.9.7",
"@types/react": "^18.0.0",
"@types/react-copy-to-clipboard": "^5.0.0",
Expand Down Expand Up @@ -272,6 +270,7 @@
"pretty-format": "^29.0.0",
"prismjs": "^1.29.0",
"progress": "^2.0.3",
"puppeteer": "^21.1.1",
"qs": "^6.10.1",
"rc-footer": "^0.6.8",
"rc-tween-one": "^3.0.3",
Expand Down
8 changes: 6 additions & 2 deletions tests/shared/imageTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,20 @@ export default function imageTest(component: React.ReactElement) {
styleStr,
);

await page.waitForSelector('#end-of-screen');
await page.waitForSelector('#end-of-screen', {
timeout: 0,
});

const image = await page.screenshot({
fullPage: true,
captureBeyondViewport: true,
optimizeForSpeed: true,
});

expect(image).toMatchImageSnapshot();

MockDate.reset();
page.removeListener('request', onRequestHandle);
page.off('request', onRequestHandle);
});
}

Expand Down

0 comments on commit 54316f7

Please sign in to comment.