diff --git a/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts b/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts index 8cd788f7793..6630c242d34 100644 --- a/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts +++ b/apps/server/src/modules/learnroom/service/common-cartridge-export.service.spec.ts @@ -77,7 +77,10 @@ describe('CommonCartridgeExportService', () => { {} as ComponentProperties, ], }); - tasks = taskFactory.buildListWithId(5); + tasks = taskFactory.buildListWithId(5, { + name: 'Task of a lesson', + lesson: lessons[0], + }); }); afterAll(async () => { @@ -148,6 +151,14 @@ describe('CommonCartridgeExportService', () => { }); }); + it('should add tasks of lesson to manifest file', () => { + const manifest = archive.getEntry('imsmanifest.xml')?.getData().toString(); + lessons[0].tasks.getItems().forEach((task) => { + expect(manifest).toContain(`${task.name}`); + expect(manifest).toContain(`identifier="i${task.id}" type="webcontent" intendeduse="unspecified"`); + }); + }); + it('should add version 1 information to manifest file', () => { const manifest = archive.getEntry('imsmanifest.xml')?.getData().toString(); expect(manifest).toContain(CommonCartridgeVersion.V_1_1_0); @@ -198,6 +209,14 @@ describe('CommonCartridgeExportService', () => { }); }); + it('should add tasks of lesson to manifest file', () => { + const manifest = archive.getEntry('imsmanifest.xml')?.getData().toString(); + lessons[0].tasks.getItems().forEach((task) => { + expect(manifest).toContain(`${task.name}`); + expect(manifest).toContain(`identifier="i${task.id}" type="webcontent" intendeduse="assignment"`); + }); + }); + it('should add version 3 information to manifest file', () => { const manifest = archive.getEntry('imsmanifest.xml')?.getData().toString(); expect(manifest).toContain(CommonCartridgeVersion.V_1_3_0);