Skip to content

Commit

Permalink
Fixed tests in getLearningElement
Browse files Browse the repository at this point in the history
  • Loading branch information
Lizardguard committed Sep 18, 2024
1 parent d0b6295 commit 1dd0cb3
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import { getLearningElementIcon } from "../../../Core/Presentation/Utils/GetLear
// components is the path to the icon.
describe("GetLearningElementIcon should return a react component for valid element types", () => {
test.each([
["text" as LearningElementTypeStrings, "text-icon"],
["image" as LearningElementTypeStrings, "image-icon"],
["video" as LearningElementTypeStrings, "video-icon"],
["h5p" as LearningElementTypeStrings, "h5p-icon"],
["pdf" as LearningElementTypeStrings, "text-icon"],
["adaptivity" as LearningElementTypeStrings, "quiz-icon"],
["text" as LearningElementTypeStrings, "text.svg"],
["image" as LearningElementTypeStrings, "image.svg"],
["video" as LearningElementTypeStrings, "video"],
["h5p" as LearningElementTypeStrings, "h5p"],
["pdf" as LearningElementTypeStrings, "text"],
["adaptivity" as LearningElementTypeStrings, "quiz"],
])("should run for %s", (type, expected) => {
const result = getLearningElementIcon(type);
expect(result.props["src"]).toContain(expected);
});

test("should return default task icon, if no valid input is delivered", () => {
const result = getLearningElementIcon("" as LearningElementTypeStrings);
expect(result.props["src"]).toContain("task-icon");
expect(result.props["src"]).toContain("learning-elements");
});
});

0 comments on commit 1dd0cb3

Please sign in to comment.