Skip to content

Commit

Permalink
EW-359 modified test of export service
Browse files Browse the repository at this point in the history
  • Loading branch information
Fshmit committed Nov 28, 2023
1 parent b9273d9 commit 599ccf5
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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(`<title>${task.name}</title>`);
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);
Expand Down Expand Up @@ -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(`<title>${task.name}</title>`);
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);
Expand Down

0 comments on commit 599ccf5

Please sign in to comment.