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/test_assets/questions/answers.testdata.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								backend/tests/test_assets/questions/answers.testdata.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,36 @@ | |||
| import { Connection, EntityManager, IDatabaseDriver } from '@mikro-orm/core'; | ||||
| import { Answer } from '../../../src/entities/questions/answer.entity'; | ||||
| import { Teacher } from '../../../src/entities/users/teacher.entity'; | ||||
| import { Question } from '../../../src/entities/questions/question.entity'; | ||||
| 
 | ||||
| export function makeTestAnswers( | ||||
|     em: EntityManager<IDatabaseDriver<Connection>>, | ||||
|     teachers: Array<Teacher>, | ||||
|     questions: Array<Question> | ||||
| ): Array<Answer> { | ||||
|     const answer01 = em.create(Answer, { | ||||
|         author: teachers[0], | ||||
|         toQuestion: questions[1], | ||||
|         sequenceNumber: 1, | ||||
|         timestamp: new Date(), | ||||
|         content: 'answer', | ||||
|     }); | ||||
| 
 | ||||
|     const answer02 = em.create(Answer, { | ||||
|         author: teachers[0], | ||||
|         toQuestion: questions[1], | ||||
|         sequenceNumber: 2, | ||||
|         timestamp: new Date(), | ||||
|         content: 'answer2', | ||||
|     }); | ||||
| 
 | ||||
|     const answer03 = em.create(Answer, { | ||||
|         author: teachers[1], | ||||
|         toQuestion: questions[3], | ||||
|         sequenceNumber: 1, | ||||
|         timestamp: new Date(), | ||||
|         content: 'answer3', | ||||
|     }); | ||||
| 
 | ||||
|     return [answer01, answer02, answer03]; | ||||
| } | ||||
							
								
								
									
										51
									
								
								backend/tests/test_assets/questions/questions.testdata.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								backend/tests/test_assets/questions/questions.testdata.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,51 @@ | |||
| import { Connection, EntityManager, IDatabaseDriver } from '@mikro-orm/core'; | ||||
| import { Question } from '../../../src/entities/questions/question.entity'; | ||||
| import { Language } from '../../../src/entities/content/language'; | ||||
| import { Student } from '../../../src/entities/users/student.entity'; | ||||
| 
 | ||||
| export function makeTestQuestions( | ||||
|     em: EntityManager<IDatabaseDriver<Connection>>, | ||||
|     students: Array<Student> | ||||
| ): Array<Question> { | ||||
|     const question01 = em.create(Question, { | ||||
|         learningObjectLanguage: Language.English, | ||||
|         learningObjectVersion: '1', | ||||
|         learningObjectHruid: 'id05', | ||||
|         sequenceNumber: 1, | ||||
|         author: students[0], | ||||
|         timestamp: new Date(), | ||||
|         content: 'question', | ||||
|     }); | ||||
| 
 | ||||
|     const question02 = em.create(Question, { | ||||
|         learningObjectLanguage: Language.English, | ||||
|         learningObjectVersion: '1', | ||||
|         learningObjectHruid: 'id05', | ||||
|         sequenceNumber: 2, | ||||
|         author: students[2], | ||||
|         timestamp: new Date(), | ||||
|         content: 'question', | ||||
|     }); | ||||
| 
 | ||||
|     const question03 = em.create(Question, { | ||||
|         learningObjectLanguage: Language.English, | ||||
|         learningObjectVersion: '1', | ||||
|         learningObjectHruid: 'id04', | ||||
|         sequenceNumber: 1, | ||||
|         author: students[0], | ||||
|         timestamp: new Date(), | ||||
|         content: 'question', | ||||
|     }); | ||||
| 
 | ||||
|     const question04 = em.create(Question, { | ||||
|         learningObjectLanguage: Language.English, | ||||
|         learningObjectVersion: '1', | ||||
|         learningObjectHruid: 'id01', | ||||
|         sequenceNumber: 1, | ||||
|         author: students[1], | ||||
|         timestamp: new Date(), | ||||
|         content: 'question', | ||||
|     }); | ||||
| 
 | ||||
|     return [question01, question02, question03, question04]; | ||||
| } | ||||
		Reference in a new issue
	
	 Laure Jablonski
						Laure Jablonski