Skip to content

Commit

Permalink
✅ [placeholder-pdfkit] Cover the addition of appName
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuch committed Jan 11, 2024
1 parent 203c064 commit cb651c3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/placeholder-pdfkit/src/pdfkitAddPlaceholder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,28 @@ describe(pdfkitAddPlaceholder, () => {
'**********',
]);
});

it('sets the Prop_Build dictionary for the signature', async () => {
const {pdf} = createPdfkitDocument(PDFDocument, {});
const widgetRect = [100, 100, 200, 200];
const refs = pdfkitAddPlaceholder({
...defaults,
pdf,
pdfBuffer: Buffer.from([pdf]),
reason: 'test reason',
widgetRect,
appName: 'signpdf',
});
expect(Object.keys(refs)).toEqual(expect.arrayContaining([
'signature',
'form',
'widget',
]));
expect(pdf.page.dictionary.data.Annots).toHaveLength(1);
const widget = pdf.page.dictionary.data.Annots[0];
const propBuild = widget.data.V.data.Prop_Build;

expect(propBuild.Filter.Name).toEqual('Adobe.PPKLite');
expect(propBuild.App.Name).toEqual('signpdf');
});
});

0 comments on commit cb651c3

Please sign in to comment.