feat: allow specifying pageSize for print (#22014)

This commit is contained in:
Shelley Vohr 2020-02-05 04:25:02 +00:00 committed by GitHub
parent 385388dd6b
commit 928175bdfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 2 deletions

View file

@ -128,6 +128,13 @@ describe('webContents module', () => {
}).to.throw('webContents.print(): Invalid deviceName provided.')
})
it('throws when an invalid pageSize is passed', () => {
expect(() => {
// @ts-ignore this line is intentionally incorrect
w.webContents.print({ pageSize: 'i-am-a-bad-pagesize' }, () => {})
}).to.throw('Unsupported pageSize: i-am-a-bad-pagesize')
})
it('does not crash', () => {
expect(() => {
w.webContents.print({ silent: true })