Merge branch 'dev' into refactor/common

This commit is contained in:
Tibo De Peuter 2025-04-01 21:38:50 +02:00
commit a4408b5bc0
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
145 changed files with 3437 additions and 2822 deletions

View file

@ -47,8 +47,6 @@ async function initPersonalizationTestData(): Promise<{
await learningObjectRepo.save(learningContent.extraExerciseObject);
await learningPathRepo.save(learningContent.learningPath);
console.log(await getSubmissionRepository().findAll({}));
const studentA = studentRepo.create({
username: 'student_a',
firstName: 'Aron',
@ -129,7 +127,7 @@ describe('DatabaseLearningPathProvider', () => {
const learningObjectsOnPath = (
await Promise.all(
example.learningPath.nodes.map((node) =>
example.learningPath.nodes.map(async (node) =>
learningObjectService.getLearningObjectById({
hruid: node.learningObjectHruid,
version: node.version,

View file

@ -39,8 +39,8 @@ describe('LearningPathService', () => {
expect(result.success).toBeTruthy();
expect(result.data?.filter((it) => it.hruid === TEST_DWENGO_LEARNING_PATH_HRUID).length).not.toBe(0);
expect(result.data?.filter((it) => it.hruid === example.learningPath.hruid).length).not.toBe(0);
expect(result.data?.filter((it) => it.hruid === TEST_DWENGO_LEARNING_PATH_HRUID)[0].title).toEqual(TEST_DWENGO_LEARNING_PATH_TITLE);
expect(result.data?.filter((it) => it.hruid === example.learningPath.hruid)[0].title).toEqual(example.learningPath.title);
expect(result.data?.find((it) => it.hruid === TEST_DWENGO_LEARNING_PATH_HRUID)?.title).toEqual(TEST_DWENGO_LEARNING_PATH_TITLE);
expect(result.data?.find((it) => it.hruid === example.learningPath.hruid)?.title).toEqual(example.learningPath.title);
});
it('should include both the learning objects from the Dwengo API and learning objects from the database in its response', async () => {
const result = await learningPathService.fetchLearningPaths([example.learningPath.hruid], example.learningPath.language, 'the source');