style: format en linting
This commit is contained in:
parent
4cb1469479
commit
e2bf413f35
22 changed files with 41 additions and 71 deletions
|
@ -2,7 +2,7 @@ import { beforeAll, describe, expect, it } from 'vitest';
|
|||
import { setupTestApp } from '../../setup-tests';
|
||||
import { AssignmentRepository } from '../../../src/data/assignments/assignment-repository';
|
||||
import { getAssignmentRepository } from '../../../src/data/repositories';
|
||||
import { getClass01, getClass02 } from '../../test_assets/classes/classes.testdata';
|
||||
import { getClass02 } from '../../test_assets/classes/classes.testdata';
|
||||
import { getAssignment02, getAssignment03 } from '../../test_assets/assignments/assignments.testdata';
|
||||
import { getTestleerkracht1 } from '../../test_assets/users/teachers.testdata';
|
||||
|
||||
|
@ -17,7 +17,7 @@ describe('AssignmentRepository', () => {
|
|||
it('should return the requested assignment', async () => {
|
||||
const class_ = getClass02();
|
||||
const usedAssignment = getAssignment02();
|
||||
const assignment = await assignmentRepository.findByClassAndId(class_!, 21001);
|
||||
const assignment = await assignmentRepository.findByClassAndId(class_, 21001);
|
||||
|
||||
expect(assignment).toBeTruthy();
|
||||
expect(assignment!.description).toBe(usedAssignment.description);
|
||||
|
@ -30,7 +30,7 @@ describe('AssignmentRepository', () => {
|
|||
it('should return all assignments for a class', async () => {
|
||||
const class_ = getClass02();
|
||||
const usedAssignment = getAssignment02();
|
||||
const assignments = await assignmentRepository.findAllAssignmentsInClass(class_!);
|
||||
const assignments = await assignmentRepository.findAllAssignmentsInClass(class_);
|
||||
|
||||
expect(assignments).toBeTruthy();
|
||||
expect(assignments).toHaveLength(1);
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { beforeAll, describe, expect, it } from 'vitest';
|
||||
import { setupTestApp } from '../../setup-tests';
|
||||
import { GroupRepository } from '../../../src/data/assignments/group-repository';
|
||||
import { getAssignmentRepository, getClassRepository, getGroupRepository } from '../../../src/data/repositories';
|
||||
import { getClass01 } from '../../test_assets/classes/classes.testdata';
|
||||
import { getGroupRepository } from '../../../src/data/repositories';
|
||||
import { getAssignment01, getAssignment02 } from '../../test_assets/assignments/assignments.testdata';
|
||||
import { getTestGroup01, getTestGroup02, getTestGroup03 } from '../../test_assets/assignments/groups.testdata';
|
||||
import { getDireStraits, getNoordkaap } from '../../test_assets/users/students.testdata';
|
||||
|
@ -21,7 +20,7 @@ describe('GroupRepository', () => {
|
|||
const member1 = getNoordkaap();
|
||||
const member2 = getDireStraits();
|
||||
|
||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, usedGroup.groupNumber!);
|
||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment, usedGroup.groupNumber!);
|
||||
|
||||
expect(group).toBeTruthy();
|
||||
expect(group?.groupNumber).toBe(usedGroup.groupNumber);
|
||||
|
@ -36,7 +35,7 @@ describe('GroupRepository', () => {
|
|||
const gr2 = getTestGroup02();
|
||||
const gr3 = getTestGroup03();
|
||||
|
||||
const groups = await groupRepository.findAllGroupsForAssignment(assignment!);
|
||||
const groups = await groupRepository.findAllGroupsForAssignment(assignment);
|
||||
|
||||
expect(groups).toBeTruthy();
|
||||
expect(groups).toHaveLength(3);
|
||||
|
@ -49,9 +48,9 @@ describe('GroupRepository', () => {
|
|||
const assignment = getAssignment02();
|
||||
const deleted = getTestGroup01();
|
||||
|
||||
await groupRepository.deleteByAssignmentAndGroupNumber(assignment!, deleted.groupNumber!);
|
||||
await groupRepository.deleteByAssignmentAndGroupNumber(assignment, deleted.groupNumber!);
|
||||
|
||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, deleted.groupNumber!);
|
||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment, deleted.groupNumber!);
|
||||
|
||||
expect(group).toBeNull();
|
||||
});
|
||||
|
|
|
@ -2,20 +2,12 @@ import { beforeAll, describe, expect, it } from 'vitest';
|
|||
import { setupTestApp } from '../../setup-tests';
|
||||
import { SubmissionRepository } from '../../../src/data/assignments/submission-repository';
|
||||
import {
|
||||
getAssignmentRepository,
|
||||
getClassRepository,
|
||||
getGroupRepository,
|
||||
getStudentRepository,
|
||||
getSubmissionRepository,
|
||||
} from '../../../src/data/repositories';
|
||||
import { LearningObjectIdentifier } from '../../../src/entities/content/learning-object-identifier';
|
||||
import { Language } from '@dwengo-1/common/util/language';
|
||||
import { Submission } from '../../../src/entities/assignments/submission.entity';
|
||||
import { Class } from '../../../src/entities/classes/class.entity';
|
||||
import { Assignment } from '../../../src/entities/assignments/assignment.entity';
|
||||
import { testLearningObject01, testLearningObject03 } from '../../test_assets/content/learning-objects.testdata';
|
||||
import { testLearningObject01 } from '../../test_assets/content/learning-objects.testdata';
|
||||
import { getSubmission01, getSubmission02, getSubmission07, getSubmission08 } from '../../test_assets/assignments/submission.testdata';
|
||||
import { use } from 'marked';
|
||||
import { getAssignment01 } from '../../test_assets/assignments/assignments.testdata';
|
||||
import { getTestGroup02 } from '../../test_assets/assignments/groups.testdata';
|
||||
|
||||
|
@ -42,7 +34,7 @@ describe('SubmissionRepository', () => {
|
|||
const usedSubmission = getSubmission02();
|
||||
const id = new LearningObjectIdentifier(usedSubmission.learningObjectHruid, usedSubmission.learningObjectLanguage, usedSubmission.learningObjectVersion);
|
||||
|
||||
const submission = await submissionRepository.findMostRecentSubmissionForStudent(id, usedSubmission.submitter!);
|
||||
const submission = await submissionRepository.findMostRecentSubmissionForStudent(id, usedSubmission.submitter);
|
||||
|
||||
expect(submission).toBeTruthy();
|
||||
expect(submission?.submissionTime).toStrictEqual(usedSubmission.submissionTime);
|
||||
|
@ -67,7 +59,7 @@ describe('SubmissionRepository', () => {
|
|||
language: usedSubmission.learningObjectLanguage,
|
||||
version: usedSubmission.learningObjectVersion,
|
||||
};
|
||||
const result = await submissionRepository.findAllSubmissionsForLearningObjectAndAssignment(loId, assignment!);
|
||||
const result = await submissionRepository.findAllSubmissionsForLearningObjectAndAssignment(loId, assignment);
|
||||
sortSubmissions(result);
|
||||
|
||||
expect(result).toHaveLength(3);
|
||||
|
@ -94,7 +86,7 @@ describe('SubmissionRepository', () => {
|
|||
version: usedSubmission.learningObjectVersion,
|
||||
};
|
||||
|
||||
const result = await submissionRepository.findAllSubmissionsForLearningObjectAndGroup(loId, group!);
|
||||
const result = await submissionRepository.findAllSubmissionsForLearningObjectAndGroup(loId, group);
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue