style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-04-24 14:57:01 +00:00
parent 4a6b6ee061
commit 437c2ba2fe
9 changed files with 170 additions and 170 deletions

View file

@ -1,65 +1,65 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { AssignmentController } from '../../src/controllers/assignments';
import { AssignmentDTO } from '@dwengo-1/common/interfaces/assignment';
import { describe, it, expect, beforeEach } from "vitest";
import { AssignmentController } from "../../src/controllers/assignments";
import { AssignmentDTO } from "@dwengo-1/common/interfaces/assignment";
describe('AssignmentController Tests', () => {
let controller: AssignmentController;
describe("AssignmentController Tests", () => {
let controller: AssignmentController;
beforeEach(() => {
controller = new AssignmentController('8764b861-90a6-42e5-9732-c0d9eb2f55f9'); // Example class ID
});
beforeEach(() => {
controller = new AssignmentController("8764b861-90a6-42e5-9732-c0d9eb2f55f9"); // Example class ID
});
it('should fetch all assignments', async () => {
const result = await controller.getAll(true);
expect(result).toHaveProperty('assignments');
expect(Array.isArray(result.assignments)).toBe(true);
expect(result.assignments.length).toBeGreaterThan(0);
});
it("should fetch all assignments", async () => {
const result = await controller.getAll(true);
expect(result).toHaveProperty("assignments");
expect(Array.isArray(result.assignments)).toBe(true);
expect(result.assignments.length).toBeGreaterThan(0);
});
it('should fetch an assignment by number', async () => {
const assignmentNumber = 21000; // Example assignment ID
const result = await controller.getByNumber(assignmentNumber);
expect(result).toHaveProperty('assignment');
expect(result.assignment).toHaveProperty('id', assignmentNumber);
});
it("should fetch an assignment by number", async () => {
const assignmentNumber = 21000; // Example assignment ID
const result = await controller.getByNumber(assignmentNumber);
expect(result).toHaveProperty("assignment");
expect(result.assignment).toHaveProperty("id", assignmentNumber);
});
it('should update an existing assignment', async () => {
const assignmentNumber = 21000;
const updatedData = { title: 'Updated Assignment Title' };
const result = await controller.updateAssignment(assignmentNumber, updatedData);
expect(result).toHaveProperty('assignment');
expect(result.assignment).toHaveProperty('id', assignmentNumber);
expect(result.assignment).toHaveProperty('title', updatedData.title);
});
it("should update an existing assignment", async () => {
const assignmentNumber = 21000;
const updatedData = { title: "Updated Assignment Title" };
const result = await controller.updateAssignment(assignmentNumber, updatedData);
expect(result).toHaveProperty("assignment");
expect(result.assignment).toHaveProperty("id", assignmentNumber);
expect(result.assignment).toHaveProperty("title", updatedData.title);
});
it('should fetch submissions for an assignment', async () => {
const assignmentNumber = 21000;
const result = await controller.getSubmissions(assignmentNumber, true);
expect(result).toHaveProperty('submissions');
expect(Array.isArray(result.submissions)).toBe(true);
});
it("should fetch submissions for an assignment", async () => {
const assignmentNumber = 21000;
const result = await controller.getSubmissions(assignmentNumber, true);
expect(result).toHaveProperty("submissions");
expect(Array.isArray(result.submissions)).toBe(true);
});
it('should fetch questions for an assignment', async () => {
const assignmentNumber = 21000;
const result = await controller.getQuestions(assignmentNumber, true);
expect(result).toHaveProperty('questions');
expect(Array.isArray(result.questions)).toBe(true);
});
it("should fetch questions for an assignment", async () => {
const assignmentNumber = 21000;
const result = await controller.getQuestions(assignmentNumber, true);
expect(result).toHaveProperty("questions");
expect(Array.isArray(result.questions)).toBe(true);
});
it('should fetch groups for an assignment', async () => {
const assignmentNumber = 21000;
const result = await controller.getGroups(assignmentNumber, true);
expect(result).toHaveProperty('groups');
expect(Array.isArray(result.groups)).toBe(true);
});
it("should fetch groups for an assignment", async () => {
const assignmentNumber = 21000;
const result = await controller.getGroups(assignmentNumber, true);
expect(result).toHaveProperty("groups");
expect(Array.isArray(result.groups)).toBe(true);
});
it('should handle fetching a non-existent assignment', async () => {
const assignmentNumber = 99999; // Non-existent assignment ID
await expect(controller.getByNumber(assignmentNumber)).rejects.toThrow();
});
it("should handle fetching a non-existent assignment", async () => {
const assignmentNumber = 99999; // Non-existent assignment ID
await expect(controller.getByNumber(assignmentNumber)).rejects.toThrow();
});
it('should handle deleting a non-existent assignment', async () => {
const assignmentNumber = 99999; // Non-existent assignment ID
await expect(controller.deleteAssignment(assignmentNumber)).rejects.toThrow();
});
it("should handle deleting a non-existent assignment", async () => {
const assignmentNumber = 99999; // Non-existent assignment ID
await expect(controller.deleteAssignment(assignmentNumber)).rejects.toThrow();
});
});

View file

@ -1,8 +1,8 @@
import { describe, expect, it } from 'vitest';
import { ClassController } from '../../src/controllers/classes';
import { describe, expect, it } from "vitest";
import { ClassController } from "../../src/controllers/classes";
describe('Test controller classes', () => {
it('Get classes', async () => {
describe("Test controller classes", () => {
it("Get classes", async () => {
const controller = new ClassController();
const data = await controller.getAll(true);
expect(data.classes).to.have.length.greaterThan(0);

View file

@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest';
import { GroupController } from '../../src/controllers/groups';
import { describe, expect, it } from "vitest";
import { GroupController } from "../../src/controllers/groups";
describe('Test controller groups', () => {
it('Get groups', async () => {
const classId = '8764b861-90a6-42e5-9732-c0d9eb2f55f9';
describe("Test controller groups", () => {
it("Get groups", async () => {
const classId = "8764b861-90a6-42e5-9732-c0d9eb2f55f9";
const assignmentNumber = 21000;
const controller = new GroupController(classId, assignmentNumber);

View file

@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { LearningPathController } from '../../src/controllers/learning-paths';
import { Language } from '../../src/data-objects/language';
import { beforeEach, describe, expect, it } from "vitest";
import { LearningPathController } from "../../src/controllers/learning-paths";
import { Language } from "../../src/data-objects/language";
describe("Test controller learning paths", () => {
let controller: LearningPathController;

View file

@ -1,25 +1,25 @@
import { StudentController } from '../../src/controllers/students';
import { beforeEach, describe, expect, it } from 'vitest';
import { StudentController } from "../../src/controllers/students";
import { beforeEach, describe, expect, it } from "vitest";
describe('Test controller students', () => {
describe("Test controller students", () => {
let controller: StudentController;
beforeEach(async () => {
controller = new StudentController();
});
it('Get students', async () => {
it("Get students", async () => {
const data = await controller.getAll(true);
expect(data.students).to.have.length.greaterThan(0);
});
it('Get student by username', async () => {
const username = 'testleerling1';
it("Get student by username", async () => {
const username = "testleerling1";
const data = await controller.getByUsername(username);
expect(data.student.username).to.equal(username);
});
it('Get classes of student', async () => {
it("Get classes of student", async () => {
const students = await controller.getAll(true);
for (const student of students.students) {

View file

@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
import { SubmissionController } from '../../src/controllers/submissions';
import { Language } from '../../src/data-objects/language';
import { describe, expect, it } from "vitest";
import { SubmissionController } from "../../src/controllers/submissions";
import { Language } from "../../src/data-objects/language";
describe("Test controller submissions", () => {
it("Get submission by number", async () => {

View file

@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { TeacherController } from '../../src/controllers/teachers';
import { beforeEach, describe, expect, it } from "vitest";
import { TeacherController } from "../../src/controllers/teachers";
describe("Test controller teachers", () => {
let controller: TeacherController;