From 57da85e14a932754684cdf597ed7286151b04c1f Mon Sep 17 00:00:00 2001 From: Lint Action Date: Sun, 18 May 2025 11:41:17 +0000 Subject: [PATCH] style: fix linting issues met Prettier --- .../controllers/classes-controller.test.ts | 1 - frontend/tests/utils/array-utils.test.ts | 33 +++++++++---------- frontend/tests/utils/assignment-utils.test.ts | 7 ++-- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/frontend/tests/controllers/classes-controller.test.ts b/frontend/tests/controllers/classes-controller.test.ts index 927fab57..82c95e17 100644 --- a/frontend/tests/controllers/classes-controller.test.ts +++ b/frontend/tests/controllers/classes-controller.test.ts @@ -22,7 +22,6 @@ describe("ClassController Tests", () => { expect(result.class).toHaveProperty("id", testClassId); }); - it("should fetch students for a class", async () => { const result = await controller.getStudents(testClassId, true); expect(result).toHaveProperty("students"); diff --git a/frontend/tests/utils/array-utils.test.ts b/frontend/tests/utils/array-utils.test.ts index 1b7f54be..ee810d3a 100644 --- a/frontend/tests/utils/array-utils.test.ts +++ b/frontend/tests/utils/array-utils.test.ts @@ -1,33 +1,33 @@ -import {copyArrayWith} from "../../src/utils/array-utils"; +import { copyArrayWith } from "../../src/utils/array-utils"; import { describe, it, expect } from "vitest"; -describe('copyArrayWith', () => { - it('should replace the element at the specified index', () => { +describe("copyArrayWith", () => { + it("should replace the element at the specified index", () => { const original = [1, 2, 3, 4]; const result = copyArrayWith(2, 99, original); expect(result).toEqual([1, 2, 99, 4]); }); - it('should not modify the original array', () => { - const original = ['a', 'b', 'c']; - const result = copyArrayWith(1, 'x', original); - expect(original).toEqual(['a', 'b', 'c']); // Original remains unchanged - expect(result).toEqual(['a', 'x', 'c']); + it("should not modify the original array", () => { + const original = ["a", "b", "c"]; + const result = copyArrayWith(1, "x", original); + expect(original).toEqual(["a", "b", "c"]); // Original remains unchanged + expect(result).toEqual(["a", "x", "c"]); }); - it('should handle replacing the first element', () => { + it("should handle replacing the first element", () => { const original = [true, false, true]; const result = copyArrayWith(0, false, original); expect(result).toEqual([false, false, true]); }); - it('should handle replacing the last element', () => { - const original = ['apple', 'banana', 'cherry']; - const result = copyArrayWith(2, 'date', original); - expect(result).toEqual(['apple', 'banana', 'date']); + it("should handle replacing the last element", () => { + const original = ["apple", "banana", "cherry"]; + const result = copyArrayWith(2, "date", original); + expect(result).toEqual(["apple", "banana", "date"]); }); - it('should work with complex objects', () => { + it("should work with complex objects", () => { const original = [{ id: 1 }, { id: 2 }, { id: 3 }]; const newValue = { id: 99 }; const result = copyArrayWith(1, newValue, original); @@ -35,14 +35,13 @@ describe('copyArrayWith', () => { expect(original[1].id).toBe(2); // Original remains unchanged }); - - it('should allow setting to undefined', () => { + it("should allow setting to undefined", () => { const original = [1, 2, 3]; const result = copyArrayWith(1, undefined, original); expect(result).toEqual([1, undefined, 3]); }); - it('should allow setting to null', () => { + it("should allow setting to null", () => { const original = [1, 2, 3]; const result = copyArrayWith(1, null, original); expect(result).toEqual([1, null, 3]); diff --git a/frontend/tests/utils/assignment-utils.test.ts b/frontend/tests/utils/assignment-utils.test.ts index 46f99af8..42140638 100644 --- a/frontend/tests/utils/assignment-utils.test.ts +++ b/frontend/tests/utils/assignment-utils.test.ts @@ -1,6 +1,6 @@ -import {LearningPathNode} from "@dwengo-1/backend/dist/entities/content/learning-path-node.entity"; -import {calculateProgress} from "../../src/utils/assignment-utils"; -import {LearningPath} from "../../src/data-objects/learning-paths/learning-path"; +import { LearningPathNode } from "@dwengo-1/backend/dist/entities/content/learning-path-node.entity"; +import { calculateProgress } from "../../src/utils/assignment-utils"; +import { LearningPath } from "../../src/data-objects/learning-paths/learning-path"; import { describe, it, expect } from "vitest"; describe("calculateProgress", () => { @@ -68,7 +68,6 @@ describe("calculateProgress", () => { expect(calculateProgress(lp)).toBeCloseTo(66.666, 2); }); - it("should handle edge case where amountOfNodesLeft is negative", () => { const lp = new LearningPath({ language: "en",