import PDFDocument from '../../lib/document'; describe('Image', function () { /** * @type {PDFDocument} */ let document; beforeEach(() => { document = new PDFDocument({ info: { CreationDate: new Date(Date.UTC(2018, 1, 1)) }, }); }); test('y position should be updated', () => { const originalY = document.y; const imageHeight = 400; document.image('./tests/images/bee.png'); expect(document.y).toBe(originalY + imageHeight); }); });