Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pdf-service): add metadata to BerH and PKH pdfs #1448

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Conversation

rbrtrfl
Copy link
Contributor

@rbrtrfl rbrtrfl commented Nov 19, 2024

Metadata is added to the filled PDF forms. When pages are appended to the existing PDF form (which is the case for both BerH and PKH), the metadata from the main PDF (to which the other one will be appended to) is taken over. So adding metadata to the attachmens and checklists is redundant.

@rbrtrfl rbrtrfl added the RAST label Nov 19, 2024
Copy link
Member

@chohner chohner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines +30 to +44
it("should add metadata to the PDF document", () => {
const doc = mockPdfLibDocument();

addMetadataToPdf(doc, metadata);

expect(doc.setAuthor).toHaveBeenCalledWith(metadata.AUTHOR);
expect(doc.setCreator).toHaveBeenCalledWith(metadata.CREATOR);
expect(doc.setKeywords).toHaveBeenCalledWith(metadata.KEYWORDS);
expect(doc.setLanguage).toHaveBeenCalledWith(metadata.LANGUAGE);
expect(doc.setProducer).toHaveBeenCalledWith(metadata.PRODUCER);
expect(doc.setSubject).toHaveBeenCalledWith(metadata.SUBJECT);
expect(doc.setTitle).toHaveBeenCalledWith(metadata.TITLE);
expect(doc.setCreationDate).toHaveBeenCalled();
expect(doc.setModificationDate).toHaveBeenCalled();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo this test can be removed. we shouldn't care about the implementation details of addMetadataToPdf - expecting the metadata to end up in the pdf should be more than enough

Copy link

sonarcloud bot commented Nov 21, 2024

@ekl176 ekl176 merged commit f741d6b into main Nov 21, 2024
21 checks passed
@ekl176 ekl176 deleted the move-to-pdfkit branch November 21, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants