pdfkit/tests/unit/image.spec.js
2025-04-12 10:34:43 -03:00

22 lines
484 B
JavaScript

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);
});
});