test: student repository is getest
This commit is contained in:
		
							parent
							
								
									3cd7496989
								
							
						
					
					
						commit
						5502c6c58e
					
				
					 5 changed files with 2520 additions and 393 deletions
				
			
		|  | @ -15,6 +15,20 @@ describe('StudentRepository', () => { | |||
|         studentRepository = getStudentRepository(); | ||||
|     }); | ||||
| 
 | ||||
|     it('should not return a student because username does not exist', async() => { | ||||
|         const student = await studentRepository.findByUsername('test'); | ||||
| 
 | ||||
|         expect(student).toBeNull(); | ||||
|     }); | ||||
| 
 | ||||
|     it('should return student from the datbase', async() => { | ||||
|         const student = await studentRepository.findByUsername('DireStraits'); | ||||
| 
 | ||||
|         expect(student).toBeTruthy(); | ||||
|         expect(student?.firstName).toBe('Mark'); | ||||
|         expect(student?.lastName).toBe('Knopfler'); | ||||
|     }) | ||||
| 
 | ||||
|     it('should return the queried student after he was added', async () => { | ||||
|         await studentRepository.insert( | ||||
|             new Student(username, firstName, lastName) | ||||
							
								
								
									
										0
									
								
								backend/tests/data/teachers.test.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								backend/tests/data/teachers.test.ts
									
										
									
									
									
										Normal file
									
								
							
		Reference in a new issue
	
	 Laure Jablonski
						Laure Jablonski