Skip to content

Commit

Permalink
Removed broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
usserwoutV2 committed May 19, 2024
1 parent 413b0cd commit 9667598
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
17 changes: 10 additions & 7 deletions frontend/src/test/mocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ jest.mock('react-router-dom', () => ({
jest.mock("../hooks/useUser", () => ({
__esModule: true, // this property makes it work
default: () => {
const user: GET_Responses[ApiRoutes.USER] = { courseUrl: "/api/courses", projects_url: "/api/projects/1", url: "/api/users/12", role: "teacher", email: "[email protected]", id: 12, name: "Bob", surname: "test" }
const courses: UserCourseType[] = [{courseId:1,name:"Course 1", relation: "enrolled", url:"/api/courses/1"}]
return {
user,
setUser: () => {},
courses
}



// const user: GET_Responses[ApiRoutes.USER] = { courseUrl: "/api/courses", projects_url: "/api/projects/1", url: "/api/users/12", role: "teacher", email: "test@gmail.com", id: 12, name: "Bob", surname: "test" }
// const courses: UserCourseType[] = [{courseId:1,name:"Course 1", relation: "enrolled", url:"/api/courses/1"}]
// return {
// user,
// setUser: () => {},
// courses
// }
},
}))

Expand Down
14 changes: 7 additions & 7 deletions frontend/src/test/pages/home/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jest.mock('react-router-dom', () => ({
jest.mock("../../../hooks/useUser", () => ({
__esModule: true, // this property makes it work
default: () => {
const user: GET_Responses[ApiRoutes.USER] = { courseUrl: "/api/courses", projects_url: "/api/projects/1", url: "/api/users/12", role: "teacher", email: "[email protected]", id: 12, name: "Bob", surname: "test" }
const courses: UserCourseType[] = [{courseId:1,name:"Course 1", relation: "enrolled", url:"/api/courses/1"}]
return {
user,
setUser: () => {},
courses
}
// const user: GET_Responses[ApiRoutes.USER] = { courseUrl: "/api/courses", projects_url: "/api/projects/1", url: "/api/users/12", role: "teacher", email: "test@gmail.com", id: 12, name: "Bob", surname: "test" }
// const courses: UserCourseType[] = [{courseId:1,name:"Course 1", relation: "enrolled", url:"/api/courses/1"}]
// return {
// user,
// setUser: () => {},
// courses
// }
},
}))

Expand Down

0 comments on commit 9667598

Please sign in to comment.