test: Fix merge
This commit is contained in:
		
							parent
							
								
									79393d6552
								
							
						
					
					
						commit
						1df27c2a98
					
				
					 5 changed files with 30 additions and 33 deletions
				
			
		|  | @ -19,7 +19,6 @@ | |||
|         "@mikro-orm/postgresql": "6.4.9", | ||||
|         "@mikro-orm/reflection": "6.4.9", | ||||
|         "@mikro-orm/sqlite": "6.4.9", | ||||
|         "axios": "^1.8.1", | ||||
|         "axios": "^1.8.2", | ||||
|         "cors": "^2.8.5", | ||||
|         "cross": "^1.0.0", | ||||
|  |  | |||
|  | @ -1,13 +1,13 @@ | |||
| import { beforeAll, describe, expect, it } from 'vitest'; | ||||
| import { setupTestApp } from '../../setup-tests'; | ||||
| import { setupTestApp } from '../../setup-tests.js'; | ||||
| import { | ||||
|     getAttachmentRepository, | ||||
|     getLearningObjectRepository, | ||||
| } from '../../../src/data/repositories'; | ||||
| import { AttachmentRepository } from '../../../src/data/content/attachment-repository'; | ||||
| import { LearningObjectRepository } from '../../../src/data/content/learning-object-repository'; | ||||
| import { LearningObjectIdentifier } from '../../../src/entities/content/learning-object-identifier'; | ||||
| import { Language } from '../../../src/entities/content/language'; | ||||
| } from '../../../src/data/repositories.js'; | ||||
| import { AttachmentRepository } from '../../../src/data/content/attachment-repository.js'; | ||||
| import { LearningObjectRepository } from '../../../src/data/content/learning-object-repository.js'; | ||||
| import { LearningObjectIdentifier } from '../../../src/entities/content/learning-object-identifier.js'; | ||||
| import { Language } from '../../../src/entities/content/language.js'; | ||||
| 
 | ||||
| describe('AttachmentRepository', () => { | ||||
|     let attachmentRepository: AttachmentRepository; | ||||
|  | @ -25,9 +25,10 @@ describe('AttachmentRepository', () => { | |||
|             await learningObjectRepository.findByIdentifier(id); | ||||
| 
 | ||||
|         const attachment = | ||||
|             await attachmentRepository.findByLearningObjectAndNumber( | ||||
|             await attachmentRepository.findByMostRecentVersionOfLearningObjectAndName( | ||||
|                 learningObject!, | ||||
|                 1 | ||||
|                 Language.English, | ||||
|                 'attachment01' | ||||
|             ); | ||||
| 
 | ||||
|         expect(attachment).toBeTruthy(); | ||||
|  |  | |||
|  | @ -8,7 +8,7 @@ export function makeTestAttachments( | |||
| ): Array<Attachment> { | ||||
|     const attachment01 = em.create(Attachment, { | ||||
|         learningObject: learningObjects[1], | ||||
|         sequenceNumber: 1, | ||||
|         name: 'attachment01', | ||||
|         mimeType: '', | ||||
|         content: Buffer.from(''), | ||||
|     }); | ||||
|  |  | |||
|  | @ -1,10 +1,7 @@ | |||
| import { Connection, EntityManager, IDatabaseDriver } from '@mikro-orm/core'; | ||||
| import { | ||||
|     ContentType, | ||||
|     LearningObject, | ||||
|     ReturnValue, | ||||
| } from '../../../src/entities/content/learning-object.entity'; | ||||
| import { LearningObject, ReturnValue } from '../../../src/entities/content/learning-object.entity'; | ||||
| import { Language } from '../../../src/entities/content/language'; | ||||
| import { DwengoContentType } from '../../../src/services/learning-objects/processing/content-type'; | ||||
| 
 | ||||
| export function makeTestLearningObjects( | ||||
|     em: EntityManager<IDatabaseDriver<Connection>> | ||||
|  | @ -16,11 +13,11 @@ export function makeTestLearningObjects( | |||
|     const learningObject01 = em.create(LearningObject, { | ||||
|         hruid: 'id01', | ||||
|         language: Language.English, | ||||
|         version: '1', | ||||
|         version: 1, | ||||
|         admins: [], | ||||
|         title: 'Undertow', | ||||
|         description: 'debute', | ||||
|         contentType: ContentType.Markdown, | ||||
|         contentType: DwengoContentType.TEXT_MARKDOWN, | ||||
|         keywords: [], | ||||
|         teacherExclusive: false, | ||||
|         skosConcepts: [], | ||||
|  | @ -34,17 +31,17 @@ export function makeTestLearningObjects( | |||
|         attachments: [], | ||||
|         content: Buffer.from( | ||||
|             "there's a shadow just behind me, shrouding every step i take, making every promise empty pointing every finger at me" | ||||
|         ), | ||||
|         ) | ||||
|     }); | ||||
| 
 | ||||
|     const learningObject02 = em.create(LearningObject, { | ||||
|         hruid: 'id02', | ||||
|         language: Language.English, | ||||
|         version: '1', | ||||
|         version: 1, | ||||
|         admins: [], | ||||
|         title: 'Aenema', | ||||
|         description: 'second album', | ||||
|         contentType: ContentType.Markdown, | ||||
|         contentType: DwengoContentType.TEXT_MARKDOWN, | ||||
|         keywords: [], | ||||
|         teacherExclusive: false, | ||||
|         skosConcepts: [], | ||||
|  | @ -64,11 +61,11 @@ export function makeTestLearningObjects( | |||
|     const learningObject03 = em.create(LearningObject, { | ||||
|         hruid: 'id03', | ||||
|         language: Language.English, | ||||
|         version: '1', | ||||
|         version: 1, | ||||
|         admins: [], | ||||
|         title: 'love over gold', | ||||
|         description: 'third album', | ||||
|         contentType: ContentType.Markdown, | ||||
|         contentType: DwengoContentType.TEXT_MARKDOWN, | ||||
|         keywords: [], | ||||
|         teacherExclusive: false, | ||||
|         skosConcepts: [], | ||||
|  | @ -91,11 +88,11 @@ export function makeTestLearningObjects( | |||
|     const learningObject04 = em.create(LearningObject, { | ||||
|         hruid: 'id04', | ||||
|         language: Language.English, | ||||
|         version: '1', | ||||
|         version: 1, | ||||
|         admins: [], | ||||
|         title: 'making movies', | ||||
|         description: 'fifth album', | ||||
|         contentType: ContentType.Markdown, | ||||
|         contentType: DwengoContentType.TEXT_MARKDOWN, | ||||
|         keywords: [], | ||||
|         teacherExclusive: false, | ||||
|         skosConcepts: [], | ||||
|  | @ -118,11 +115,11 @@ export function makeTestLearningObjects( | |||
|     const learningObject05 = em.create(LearningObject, { | ||||
|         hruid: 'id05', | ||||
|         language: Language.English, | ||||
|         version: '1', | ||||
|         version: 1, | ||||
|         admins: [], | ||||
|         title: 'on every street', | ||||
|         description: 'sixth album', | ||||
|         contentType: ContentType.Markdown, | ||||
|         contentType: DwengoContentType.TEXT_MARKDOWN, | ||||
|         keywords: [], | ||||
|         teacherExclusive: false, | ||||
|         skosConcepts: [], | ||||
|  |  | |||
|  | @ -1,10 +1,10 @@ | |||
| import { Connection, EntityManager, IDatabaseDriver } from '@mikro-orm/core'; | ||||
| import { | ||||
|     LearningPath, | ||||
|     LearningPathNode, | ||||
|     LearningPathTransition, | ||||
| } from '../../../src/entities/content/learning-path.entity'; | ||||
| import { Language } from '../../../src/entities/content/language'; | ||||
| import { LearningPathTransition } from '../../../src/entities/content/learning-path-transition.entity'; | ||||
| import { LearningPathNode } from '../../../src/entities/content/learning-path-node.entity'; | ||||
| 
 | ||||
| export function makeTestLearningPaths( | ||||
|     em: EntityManager<IDatabaseDriver<Connection>> | ||||
|  | @ -41,35 +41,35 @@ export function makeTestLearningPaths( | |||
|     learningPathNode01.learningObjectHruid = 'id01'; | ||||
|     learningPathNode01.startNode = true; | ||||
|     learningPathNode01.transitions = [transitions01]; | ||||
|     learningPathNode01.version = '1'; | ||||
|     learningPathNode01.version = 1; | ||||
| 
 | ||||
|     learningPathNode02.instruction = ''; | ||||
|     learningPathNode02.language = Language.English; | ||||
|     learningPathNode02.learningObjectHruid = 'id02'; | ||||
|     learningPathNode02.startNode = false; | ||||
|     learningPathNode02.transitions = [transitions02]; | ||||
|     learningPathNode02.version = '1'; | ||||
|     learningPathNode02.version = 1; | ||||
| 
 | ||||
|     learningPathNode03.instruction = ''; | ||||
|     learningPathNode03.language = Language.English; | ||||
|     learningPathNode03.learningObjectHruid = 'id03'; | ||||
|     learningPathNode03.startNode = true; | ||||
|     learningPathNode03.transitions = [transitions03]; | ||||
|     learningPathNode03.version = '1'; | ||||
|     learningPathNode03.version = 1; | ||||
| 
 | ||||
|     learningPathNode04.instruction = ''; | ||||
|     learningPathNode04.language = Language.English; | ||||
|     learningPathNode04.learningObjectHruid = 'id04'; | ||||
|     learningPathNode04.startNode = false; | ||||
|     learningPathNode04.transitions = [transitions04]; | ||||
|     learningPathNode04.version = '1'; | ||||
|     learningPathNode04.version = 1; | ||||
| 
 | ||||
|     learningPathNode05.instruction = ''; | ||||
|     learningPathNode05.language = Language.English; | ||||
|     learningPathNode05.learningObjectHruid = 'id05'; | ||||
|     learningPathNode05.startNode = false; | ||||
|     learningPathNode05.transitions = [transitions05]; | ||||
|     learningPathNode05.version = '1'; | ||||
|     learningPathNode05.version = 1; | ||||
| 
 | ||||
|     const nodes01: Array<LearningPathNode> = [ | ||||
|         // learningPathNode01,
 | ||||
|  |  | |||
		Reference in a new issue