Skip to content

Commit

Permalink
test: make sure zero-width screenshots don't hang
Browse files Browse the repository at this point in the history
References puppeteer#2672.
  • Loading branch information
aslushnikov committed Sep 7, 2018
1 parent aeb6a99 commit 4289a6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/elementhandle.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ module.exports.addTests = function({testRunner, expect}) {
const screenshotError = await elementHandle.screenshot().catch(error => error);
expect(screenshotError.message).toBe('Node is either not visible or not an HTMLElement');
});
it('should not hang with zero width/height element', async({page, server}) => {
await page.setContent('<div style="width: 0; height: 0"></div>');
const div = await page.$('div');
const screenshot = await div.screenshot();
});
});

describe('ElementHandle.$', function() {
Expand Down

0 comments on commit 4289a6e

Please sign in to comment.