mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: webContents.print parameter validation error (#38721)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -194,6 +194,14 @@ describe('webContents module', () => {
|
||||
}).to.throw('webContents.print(): Invalid print settings specified.');
|
||||
});
|
||||
|
||||
it('throws when an invalid pageSize is passed', () => {
|
||||
const badSize = 5;
|
||||
expect(() => {
|
||||
// @ts-ignore this line is intentionally incorrect
|
||||
w.webContents.print({ pageSize: badSize });
|
||||
}).to.throw(`Unsupported pageSize: ${badSize}`);
|
||||
});
|
||||
|
||||
it('throws when an invalid callback is passed', () => {
|
||||
expect(() => {
|
||||
// @ts-ignore this line is intentionally incorrect
|
||||
|
||||
Reference in New Issue
Block a user