fix: delete frontend controller tests
This commit is contained in:
		
							parent
							
								
									87366b2821
								
							
						
					
					
						commit
						593de8a53d
					
				
					 2 changed files with 0 additions and 68 deletions
				
			
		|  | @ -1,34 +0,0 @@ | ||||||
| import { describe, it, expect, beforeAll } from "vitest"; |  | ||||||
| import { StudentController } from "../../src/controllers/students"; |  | ||||||
| 
 |  | ||||||
| const controller = new StudentController(); |  | ||||||
| 
 |  | ||||||
| describe("StudentController", () => { |  | ||||||
|     const newStudent = { |  | ||||||
|         username: "teststudent1", |  | ||||||
|         firstName: "Testy", |  | ||||||
|         lastName: "McTestface", |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     beforeAll(() => { |  | ||||||
|         // Start backend
 |  | ||||||
|     }); |  | ||||||
| 
 |  | ||||||
|     it("creates a student and fetches it by username", async () => { |  | ||||||
|         // Create student
 |  | ||||||
|         await controller.createStudent(newStudent); |  | ||||||
| 
 |  | ||||||
|         // Fetch same student
 |  | ||||||
|         const fetched = await controller.getByUsername(newStudent.username); |  | ||||||
| 
 |  | ||||||
|         expect(fetched).toBeDefined(); |  | ||||||
|         expect(fetched.student).toBeDefined(); |  | ||||||
| 
 |  | ||||||
|         const student = fetched.student; |  | ||||||
|         expect(student.username).toBe(newStudent.username); |  | ||||||
|         expect(student.firstName).toBe(newStudent.firstName); |  | ||||||
|         expect(student.lastName).toBe(newStudent.lastName); |  | ||||||
| 
 |  | ||||||
|         await controller.deleteStudent(newStudent.username); |  | ||||||
|     }); |  | ||||||
| }); |  | ||||||
|  | @ -1,34 +0,0 @@ | ||||||
| import { describe, it, expect, beforeAll } from "vitest"; |  | ||||||
| import { TeacherController } from "../../src/controllers/teachers"; |  | ||||||
| 
 |  | ||||||
| const controller = new TeacherController(); |  | ||||||
| 
 |  | ||||||
| describe("TeacherController", () => { |  | ||||||
|     const newTeacher = { |  | ||||||
|         username: "testteacher3", |  | ||||||
|         firstName: "Testy", |  | ||||||
|         lastName: "McTestface", |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     beforeAll(() => { |  | ||||||
|         // Start backend
 |  | ||||||
|     }); |  | ||||||
| 
 |  | ||||||
|     it("creates a student and fetches it by username", async () => { |  | ||||||
|         // Create student
 |  | ||||||
|         await controller.createTeacher(newTeacher); |  | ||||||
| 
 |  | ||||||
|         // Fetch same student
 |  | ||||||
|         const fetched = await controller.getByUsername(newTeacher.username); |  | ||||||
| 
 |  | ||||||
|         expect(fetched).toBeDefined(); |  | ||||||
|         expect(fetched.teacher).toBeDefined(); |  | ||||||
| 
 |  | ||||||
|         const teacher = fetched.teacher; |  | ||||||
|         expect(teacher.username).toBe(newTeacher.username); |  | ||||||
|         expect(teacher.firstName).toBe(newTeacher.firstName); |  | ||||||
|         expect(teacher.lastName).toBe(newTeacher.lastName); |  | ||||||
| 
 |  | ||||||
|         await controller.deleteTeacher(newTeacher.username); |  | ||||||
|     }); |  | ||||||
| }); |  | ||||||
		Reference in a new issue
	
	 Gabriellvl
						Gabriellvl