Skip to content

Commit

Permalink
Merge branch 'main' into strapi-staging-performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer6497 committed Jan 6, 2025
2 parents dd2e840 + 49a3363 commit 0a90c0a
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 123 deletions.
3 changes: 1 addition & 2 deletions app/components/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import SVG from "react-inlinesvg";

export type ImageProps = Readonly<{
url?: string;
ext?: string;
width?: number;
height?: number;
alternativeText?: string;
Expand All @@ -12,7 +11,7 @@ export type ImageProps = Readonly<{
function Image({ url, width, height, alternativeText, ...props }: ImageProps) {
if (!url) return null;
// Need to inline SVG components for accessibility
const isSvg = props.ext === ".svg";
const isSvg = url.endsWith(".svg");
return isSvg ? (
<SVG
{...props}
Expand Down
2 changes: 1 addition & 1 deletion app/components/__test__/Image.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("Image", () => {

it("should render an svg image inline instead of as an <img> tag", () => {
const { queryByAltText } = render(
<Image url="image.svg" alternativeText={altText} ext=".svg" />,
<Image url="image.svg" alternativeText={altText} />,
);
// since react-inlinesvg parses an actual svg to create the DOM,
// we basically just need to ensure that an <img> isn't present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ describe("addReason", () => {
continued: true,
});

expect(mockDoc.text).toHaveBeenCalledWith(PASSIVE_VERB_TEXT);
expect(mockDoc.text).toHaveBeenCalledWith(PASSIVE_VERB_TEXT, {
continued: true,
});
});

it("should render document for annullierung claim", () => {
Expand All @@ -84,7 +86,9 @@ describe("addReason", () => {
continued: true,
});

expect(mockDoc.text).toHaveBeenCalledWith(PASSIVE_VERB_TEXT);
expect(mockDoc.text).toHaveBeenCalledWith(PASSIVE_VERB_TEXT, {
continued: true,
});
});

it("should render document for nichtbefoerderung claim", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const addReason = (
.font(FONTS_BUNDESSANS_REGULAR);

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

doc.text(FINAL_COLON_SENTENCE);
Expand Down
3 changes: 1 addition & 2 deletions app/services/cms/models/StrapiImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ export const getImageProps = (
cmsData: StrapiImage | null,
): ImageProps | undefined => {
if (!cmsData) return undefined;
const { url, width, height, alternativeText, ext } = cmsData;
const { url, width, height, alternativeText } = cmsData;
return {
url,
width,
ext,
height,
alternativeText: alternativeText ?? undefined,
};
Expand Down
1 change: 0 additions & 1 deletion app/services/cms/models/__test__/StrapiImage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ describe("getImageProps", () => {

expect(result).toEqual({
url: "url",
ext: ".ext",
width: 1,
height: 2,
alternativeText: "alternativeText",
Expand Down
Loading

0 comments on commit 0a90c0a

Please sign in to comment.