Skip to content

Commit

Permalink
Added unit test for ignoring false flags in acroforms
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoBrase committed Feb 5, 2024
1 parent aca8ca8 commit 1362c15
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/unit/acroform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,33 @@ describe('acroform', () => {
expect(docData).toContainChunk(expected);
});

test('false flags should be ignored', () => {
const expectedDoc = new PDFDocument({
info: { CreationDate: new Date(Date.UTC(2018, 1, 1)) }
});
expectedDoc.initForm();
const expectedDocData = logData(expectedDoc);
let emptyOpts = {
align: 'center'
};
expectedDoc.formText('flags', 20, 20, 50, 20, emptyOpts);

doc.initForm();
const docData = logData(doc);
let opts = {
required: false,
noExport: false,
readOnly: false,
align: 'center',
multiline: false,
password: false,
noSpell: false
};
doc.formText('flags', 20, 20, 50, 20, opts);

expect(docData).toContainChunk(expectedDocData);
});

test('font size', () => {
const expected = [
'11 0 obj',
Expand Down

0 comments on commit 1362c15

Please sign in to comment.