diff --git a/tests/unit/document.spec.js b/tests/unit/document.spec.js index 3f26c3d..52da4e0 100644 --- a/tests/unit/document.spec.js +++ b/tests/unit/document.spec.js @@ -32,4 +32,19 @@ describe('PDFDocument', () => { expect(fontSpy).not.toBeCalled(); }); }); + + describe('document info', () => { + + test('accepts properties with value undefined', () => { + expect(() => new PDFDocument({ info: { Title: undefined }})) + .not.toThrow(new TypeError("Cannot read property 'toString' of undefined")); + }); + + test('accepts properties with value null', () => { + expect(() => new PDFDocument({ info: { Title: null }})) + .not.toThrow(new TypeError("Cannot read property 'toString' of null")); + }); + + }); + });