Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/routes/planviewer/Planviewer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,11 @@ describe("Planviewer", () => {
test("renders verse of the day and public series", async () => {
renderPlanviewer();

expect(await screen.findByText("Verse of the day")).toBeInTheDocument();
expect(
await screen.findByText("All conditioned things are impermanent."),
await screen.findByLabelText("Verse of the day"),
).toBeInTheDocument();
expect(
await screen.findByText(/All conditioned things are impermanent\./),
).toBeInTheDocument();
expect(
await screen.findByText("200-Day Road to the ITCC 2026"),
Expand Down
5 changes: 5 additions & 0 deletions src/utils/helperFunctions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ describe("getLanguageClass", () => {
expect(getLanguageClass("")).toBe("en-serif-text");
expect(getLanguageClass("fr")).toBe("en-serif-text");
});

test("defaults to 'en-serif-text' for missing language", () => {
expect(getLanguageClass()).toBe("en-serif-text");
expect(getLanguageClass(null)).toBe("en-serif-text");
});
});

describe("isEmail", () => {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/helperFunctions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export const mapLanguageCode = (languageCode: string): string => {
languageMap[languageCode as keyof typeof languageMap] || languageMap.en
);
};
export const getLanguageClass = (language: string): string => {
export const getLanguageClass = (language?: string | null): string => {
if (!language) return "en-serif-text";
if (language === "en-san") return "en-text";

const upper = language.trim().toUpperCase();
Expand Down
Loading