fix(backend): Hernoem geteste functie

This commit is contained in:
Tibo De Peuter 2025-05-17 20:40:19 +02:00
parent 1f05935418
commit 679c95b0a0
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2

View file

@ -148,16 +148,16 @@ describe('DatabaseLearningPathProvider', () => {
});
});
describe('searchLearningPathsByAdmin', () => {
describe('getLearningPathsAdministratedBy', () => {
it('returns the learning path owned by the admin', async () => {
const expectedLearningPath = mapToLearningPath(testLearningPath02, [mapToTeacherDTO(teacherB)]);
const result = await databaseLearningPathProvider.searchLearningPathsByAdmin([teacherB], expectedLearningPath.language);
const result = await databaseLearningPathProvider.getLearningPathsAdministratedBy([teacherB], expectedLearningPath.language);
expect(result.length).toBe(1);
expect(result[0].title).toBe(expectedLearningPath.title);
expect(result[0].description).toBe(expectedLearningPath.description);
});
it('returns an empty result when querying admins that do not have custom learning paths', async () => {
const result = await databaseLearningPathProvider.searchLearningPathsByAdmin([teacherA], testLearningPath.language);
const result = await databaseLearningPathProvider.getLearningPathsAdministratedBy([teacherA], testLearningPath.language);
expect(result.length).toBe(0);
});
});