Skip to content

Commit

Permalink
test: add tests for default icons
Browse files Browse the repository at this point in the history
  • Loading branch information
sonalisin committed Oct 17, 2024
1 parent 31f2685 commit fb5f3cb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/atoms/OakIcon/OakIcon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ describe("generateOakIconURL", () => {
expect(generateOakIconURL("home")).toBe(
"https://res.cloudinary.com/mock-cloudinary-cloud/image/upload/v1699887218/icons/gvqxjxcw07ei2kkmwnes.svg",
);
expect(generateOakIconURL("banana-sandwich")).toBe(undefined);
});

it("is returns url for question mark when the string is not a valid icon name", () => {
expect(generateOakIconURL("banana-sandwich")).toBe(
"https://res.cloudinary.com/mock-cloudinary-cloud/image/upload/v1706872277/icons/question-mark.svg",
);
});

it("is returns url for books when the string is not a valid subject icon name", () => {
expect(generateOakIconURL("subject-potions")).toBe(
"https://res.cloudinary.com/mock-cloudinary-cloud/image/upload/v1699953657/icons/hz4l3iq6i68kazvkvorq.svg",
);
});
});

0 comments on commit fb5f3cb

Please sign in to comment.