error checking update

This commit is contained in:
2025-09-01 08:51:32 -06:00
parent 523a05d45e
commit ecb5f6d70f
2 changed files with 44 additions and 1 deletions

View File

@@ -40,10 +40,53 @@ describe("AssignmentHtmlTest", () => {
{
source: "insert_github_classroom_url",
destination: "findme",
strict: true,
},
],
});
expect(html).toContain(`href="findme"`);
});
it("assignment without text in description does not throw error", () => {
const name = "test assignment";
const assignment: LocalAssignment = {
name,
description: `here is the description without a classroom url`,
dueAt: "08/21/2023 23:59:00",
lockAt: "08/21/2023 23:59:00",
submissionTypes: [AssignmentSubmissionType.ONLINE_UPLOAD],
localAssignmentGroupName: "Final Project",
rubric: [],
allowedFileUploadExtensions: [],
githubClassroomAssignmentShareLink: "findme",
};
const settings: LocalCourseSettings = {
name: "test empty course",
assignmentGroups: [],
daysOfWeek: [DayOfWeek.Monday, DayOfWeek.Wednesday],
startDate: "07/09/2024 23:59:00",
endDate: "07/09/2024 23:59:00",
defaultDueTime: { hour: 1, minute: 59 },
canvasId: 0,
defaultAssignmentSubmissionTypes: [],
defaultFileUploadTypes: [],
holidays: [],
assets: [],
};
expect(() => {
markdownToHTMLSafe({
markdownString: assignment.description,
settings,
convertImages: false,
replaceText: [
{
source: "insert_github_classroom_url",
destination: "shouldn't be here",
strict: true,
},
],
});
}).not.toThrow();
});
});