Fix JS tests

This commit is contained in:
Elia Bieri 2023-05-25 14:08:53 +02:00
parent f5e367d467
commit ace5b5b21c
2 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@ describe("Guards", () => {
it("cannot route to cockpit", () => { it("cannot route to cockpit", () => {
vi.spyOn(courseSessions, "useCourseSessionsStore").mockReturnValue({ vi.spyOn(courseSessions, "useCourseSessionsStore").mockReturnValue({
hasCockpit: false, currentCourseSessionHasCockpit: false,
}); });
const slug = "test"; const slug = "test";
expect(expertRequired({ params: { courseSlug: "test" } })).toEqual( expect(expertRequired({ params: { courseSlug: "test" } })).toEqual(
@ -27,7 +27,7 @@ describe("Guards", () => {
it("can route to cockpit", () => { it("can route to cockpit", () => {
vi.spyOn(courseSessions, "useCourseSessionsStore").mockReturnValue({ vi.spyOn(courseSessions, "useCourseSessionsStore").mockReturnValue({
hasCockpit: true, currentCourseSessionHasCockpit: true,
}); });
const to = { const to = {
params: { params: {

View File

@ -66,7 +66,7 @@ describe("CourseSession Store", () => {
courseSessionsStore._currentCourseSlug = "test-course"; courseSessionsStore._currentCourseSlug = "test-course";
courseSessionsStore.allCourseSessions = courseSessions; courseSessionsStore.allCourseSessions = courseSessions;
expect(courseSessionsStore.hasCockpit).toBeFalsy(); expect(courseSessionsStore.currentCourseSessionHasCockpit).toBeFalsy();
}); });
it("superuser has cockpit", () => { it("superuser has cockpit", () => {
@ -77,7 +77,7 @@ describe("CourseSession Store", () => {
courseSessionsStore._currentCourseSlug = "test-course"; courseSessionsStore._currentCourseSlug = "test-course";
courseSessionsStore.allCourseSessions = courseSessions; courseSessionsStore.allCourseSessions = courseSessions;
expect(courseSessionsStore.hasCockpit).toBeTruthy(); expect(courseSessionsStore.currentCourseSessionHasCockpit).toBeTruthy();
}); });
it("expert has cockpit", () => { it("expert has cockpit", () => {
@ -90,6 +90,6 @@ describe("CourseSession Store", () => {
courseSessionsStore._currentCourseSlug = "test-course"; courseSessionsStore._currentCourseSlug = "test-course";
courseSessionsStore.allCourseSessions = courseSessions; courseSessionsStore.allCourseSessions = courseSessions;
expect(courseSessionsStore.hasCockpit).toBeTruthy(); expect(courseSessionsStore.currentCourseSessionHasCockpit).toBeTruthy();
}); });
}); });