diff --git a/backend/src/services/learning-paths/database-learning-path-provider.ts b/backend/src/services/learning-paths/database-learning-path-provider.ts index 925f9f6b..e99048f7 100644 --- a/backend/src/services/learning-paths/database-learning-path-provider.ts +++ b/backend/src/services/learning-paths/database-learning-path-provider.ts @@ -112,9 +112,9 @@ async function convertNodes( function optionalJsonStringToObject(jsonString?: string): object | null { if (!jsonString) { return null; - } else { + } return JSON.parse(jsonString); - } + } /** diff --git a/backend/tests/services/learning-path/database-learning-path-provider.test.ts b/backend/tests/services/learning-path/database-learning-path-provider.test.ts index 81d4a149..1088cb2e 100644 --- a/backend/tests/services/learning-path/database-learning-path-provider.test.ts +++ b/backend/tests/services/learning-path/database-learning-path-provider.test.ts @@ -94,7 +94,7 @@ function expectBranchingObjectNode(result: LearningPathResponse, persTestData: { studentA: Student; studentB: Student }): LearningObjectNode { - let branchingObjectMatches = result.data![0].nodes.filter( + const branchingObjectMatches = result.data![0].nodes.filter( it => it.learningobject_hruid === persTestData.learningContent.branchingObject.hruid ); expect(branchingObjectMatches.length).toBe(1); @@ -156,7 +156,7 @@ describe('DatabaseLearningPathProvider', () => { .transitions .filter(it => it.next.hruid === persTestData.learningContent.finalObject.hruid) .length - ).toBe(0); // studentA picked the first option, therefore, there should be no direct path to the final object. + ).toBe(0); // StudentA picked the first option, therefore, there should be no direct path to the final object. expect( branchingObject .transitions @@ -183,7 +183,7 @@ describe('DatabaseLearningPathProvider', () => { .transitions .filter(it => it.next.hruid === persTestData.learningContent.finalObject.hruid) .length - ).toBe(1); // studentB picked the second option, therefore, there should be a direct path to the final object. + ).toBe(1); // StudentB picked the second option, therefore, there should be a direct path to the final object. expect( branchingObject .transitions diff --git a/backend/tests/test-assets/learning-paths/test-conditions-example.ts b/backend/tests/test-assets/learning-paths/test-conditions-example.ts index f06ff904..9ac8c4d6 100644 --- a/backend/tests/test-assets/learning-paths/test-conditions-example.ts +++ b/backend/tests/test-assets/learning-paths/test-conditions-example.ts @@ -80,7 +80,5 @@ export function createConditionTestLearningPathAndLearningObjects(){ } const example: LearningPathExample = { - createLearningPath: () => { - return createConditionTestLearningPathAndLearningObjects().learningPath; - }, + createLearningPath: () => createConditionTestLearningPathAndLearningObjects().learningPath, };