UNCLASSIFIED

Commit 0df11b33 authored by Keith Becker's avatar Keith Becker
Browse files

refactor unit tests

parent ecf2524c
...@@ -64,10 +64,6 @@ export default { ...@@ -64,10 +64,6 @@ export default {
this.course.id this.course.id
); );
this.course.registrations = result.registrations; this.course.registrations = result.registrations;
console.log(
"updated add students to course dialog registrations is now " +
this.course.registrations.length
);
}, },
availableSeatsInCourse, availableSeatsInCourse,
canAddStudentsToCourse, canAddStudentsToCourse,
......
...@@ -108,4 +108,16 @@ describe("SelectAddStudentsToCourseDialog", () => { ...@@ -108,4 +108,16 @@ describe("SelectAddStudentsToCourseDialog", () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.vm.canSubmit).toEqual(true); expect(wrapper.vm.canSubmit).toEqual(true);
}); });
it("should call getCourseRegistrationsById when fetchDebouced is called", async () => {
CourseService.getCourseRegistrationsById = jest
.fn()
.mockResolvedValue({ registrations: [] });
CourseService.getCourse = jest.fn().mockResolvedValue({
name: "",
startDate: "2020-01-01",
});
await wrapper.vm.fetchDebounced();
expect(CourseService.getCourseRegistrationsById).toHaveBeenCalled();
expect(CourseService.getCourse).toHaveBeenCalled();
});
}); });
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment