style: verander de structuur van de testmap
This commit is contained in:
		
							parent
							
								
									5f55da987c
								
							
						
					
					
						commit
						678ced55ba
					
				
					 27 changed files with 854 additions and 706 deletions
				
			
		
							
								
								
									
										36
									
								
								backend/tests/data/content/learning-paths.test.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								backend/tests/data/content/learning-paths.test.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,36 @@ | |||
| import { beforeAll, describe, expect, it } from 'vitest'; | ||||
| import { getLearningPathRepository } from '../../../src/data/repositories'; | ||||
| import { LearningPathRepository } from '../../../src/data/content/learning-path-repository'; | ||||
| import { setupTestApp } from '../../setup-tests'; | ||||
| import { Language } from '../../../src/entities/content/language'; | ||||
| 
 | ||||
| describe('LearningPathRepository', () => { | ||||
|     let learningPathRepository: LearningPathRepository; | ||||
| 
 | ||||
|     beforeAll(async () => { | ||||
|         await setupTestApp(); | ||||
|         learningPathRepository = getLearningPathRepository(); | ||||
|     }); | ||||
| 
 | ||||
|     it('should return nothing because no match for hruid and language', async () => { | ||||
|         const learningPath = | ||||
|             await learningPathRepository.findByHruidAndLanguage( | ||||
|                 'test_id', | ||||
|                 Language.Dutch | ||||
|             ); | ||||
| 
 | ||||
|         expect(learningPath).toBeNull(); | ||||
|     }); | ||||
| 
 | ||||
|     it('should return requested learning path', async () => { | ||||
|         const learningPath = | ||||
|             await learningPathRepository.findByHruidAndLanguage( | ||||
|                 'id01', | ||||
|                 Language.English | ||||
|             ); | ||||
| 
 | ||||
|         expect(learningPath).toBeTruthy(); | ||||
|         expect(learningPath?.title).toBe('repertoire Tool'); | ||||
|         expect(learningPath?.description).toBe('all about Tool'); | ||||
|     }); | ||||
| }); | ||||
		Reference in a new issue
	
	 Laure Jablonski
						Laure Jablonski