feat: allow defaulting to printer default page size (#49523)

Co-authored-by: Edvan de Matos <edvan.santos@querodelivery.com>
This commit is contained in:
Shelley Vohr
2026-02-13 13:40:14 +01:00
committed by GitHub
parent 3a5f9e0a33
commit dcdbb0397e
7 changed files with 162 additions and 65 deletions

View File

@@ -273,6 +273,12 @@ describe('webContents module', () => {
}).to.throw(`Unsupported pageSize: ${badSize}`);
});
it('throws when a user passes both pageSize and usePrinterDefaultPageSize', () => {
expect(() => {
w.webContents.print({ pageSize: 'A4', usePrinterDefaultPageSize: true });
}).to.throw('usePrinterDefaultPageSize cannot be combined with pageSize');
});
it('throws when an invalid callback is passed', () => {
expect(() => {
// @ts-ignore this line is intentionally incorrect