fix: always callback error with invalid print settings (#24476)

This commit is contained in:
Shelley Vohr 2020-07-10 09:42:22 -07:00 committed by GitHub
parent 5737fda154
commit 6c4017ff45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 14 deletions

View file

@ -141,6 +141,17 @@ describe('webContents module', () => {
}).to.throw('Unsupported pageSize: i-am-a-bad-pagesize');
});
it('throws when an invalid custom pageSize is passed', () => {
expect(() => {
w.webContents.print({
pageSize: {
width: 100,
height: 200
}
});
}).to.throw('height and width properties must be minimum 352 microns.');
});
it('does not crash with custom margins', () => {
expect(() => {
w.webContents.print({