fix: crash on custom printing margins (#22164)

This commit is contained in:
Shelley Vohr 2020-02-13 17:15:25 +00:00 committed by GitHub
parent f97ce86d08
commit 6ed396df17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View file

@ -135,9 +135,18 @@ describe('webContents module', () => {
}).to.throw('Unsupported pageSize: i-am-a-bad-pagesize')
})
it('does not crash', () => {
it('does not crash with custom margins', () => {
expect(() => {
w.webContents.print({ silent: true })
w.webContents.print({
silent: true,
margins: {
marginType: 'custom',
top: 1,
bottom: 1,
left: 1,
right: 1
}
})
}).to.not.throw()
})
})