Skip to content

Commit

Permalink
Merge branch 'main' into validate-multiple-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
aaschlote authored Dec 30, 2024
2 parents 186125d + eb3b452 commit d7c956f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ARTICLE_NOT_MOVE_TEXT,
CANCEL_TEXT,
DELAY_TEXT,
FINAL_COLON_SENTENCE,
NOT_MOVE_TEXT,
PASSIVE_VERB_TEXT,
PLAINTIFF_BOOKED_MULTIPLE_PERSONS_TEXT,
Expand Down Expand Up @@ -107,4 +108,13 @@ describe("addReason", () => {

expect(mockDoc.text).not.toHaveBeenCalledWith(PASSIVE_VERB_TEXT);
});

it("should render document with colon", () => {
const mockStruct = mockPdfKitDocumentStructure();
const mockDoc = mockPdfKitDocument(mockStruct);

addReason(mockDoc, mockStruct, userDataMock);

expect(mockDoc.text).toHaveBeenCalledWith(FINAL_COLON_SENTENCE);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const ARTICLE_DELAY_CANCEL_TEXT = "der ";
export const ARTICLE_NOT_MOVE_TEXT = "und wurde ";
export const DELAY_TEXT = "nicht pünktlich ausgeführt ";
export const CANCEL_TEXT = "annulliert ";
export const NOT_MOVE_TEXT =
"und wurde von der beklagten Partei nicht befördert";
export const PASSIVE_VERB_TEXT = "wurde: ";
export const NOT_MOVE_TEXT = "nicht befördert";
export const PASSIVE_VERB_TEXT = "wurde";
export const FINAL_COLON_SENTENCE = ":";

const getPlaintiffBookedText = ({
isWeiterePersonen,
Expand Down Expand Up @@ -70,12 +70,16 @@ export const addReason = (
})
.text("von der beklagten Partei ", { continued: true })
.font(FONTS_BUNDESSANS_BOLD)
.text(getBereichText(userData), { continued: true })
.text(getBereichText(userData), {
continued: true,
})
.font(FONTS_BUNDESSANS_REGULAR);

if (userData.bereich !== "nichtbefoerderung") {
doc.text(PASSIVE_VERB_TEXT);
}

doc.text(FINAL_COLON_SENTENCE);
}),
);
documentStruct.add(reasonSect);
Expand Down

0 comments on commit d7c956f

Please sign in to comment.