mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
error checking update
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user