style: fix linting issues met ESLint
This commit is contained in:
parent
47e47323d3
commit
1b18338c78
15 changed files with 34 additions and 34 deletions
|
@ -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);
|
||||
|
|
|
@ -21,7 +21,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 +36,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 +49,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();
|
||||
});
|
||||
|
|
|
@ -42,7 +42,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 +67,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 +94,7 @@ describe('SubmissionRepository', () => {
|
|||
version: usedSubmission.learningObjectVersion,
|
||||
};
|
||||
|
||||
const result = await submissionRepository.findAllSubmissionsForLearningObjectAndGroup(loId, group!);
|
||||
const result = await submissionRepository.findAllSubmissionsForLearningObjectAndGroup(loId, group);
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('ClassJoinRequestRepository', () => {
|
|||
const class_ = getClass02();
|
||||
const jr1 = getClassJoinRequest01();
|
||||
const jr2 = getClassJoinRequest02();
|
||||
const requests = await classJoinRequestRepository.findAllOpenRequestsTo(class_!);
|
||||
const requests = await classJoinRequestRepository.findAllOpenRequestsTo(class_);
|
||||
|
||||
expect(requests).toBeTruthy();
|
||||
expect(requests).toHaveLength(2);
|
||||
|
@ -41,9 +41,9 @@ describe('ClassJoinRequestRepository', () => {
|
|||
it('should not find a removed request', async () => {
|
||||
const studentUsed = getSmashingPumpkins();
|
||||
const class_ = getClass03();
|
||||
await classJoinRequestRepository.deleteBy(studentUsed!, class_!);
|
||||
await classJoinRequestRepository.deleteBy(studentUsed, class_);
|
||||
|
||||
const request = await classJoinRequestRepository.findAllRequestsBy(studentUsed!);
|
||||
const request = await classJoinRequestRepository.findAllRequestsBy(studentUsed);
|
||||
|
||||
expect(request).toHaveLength(0);
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ describe('ClassRepository', () => {
|
|||
const teacher = getLimpBizkit();
|
||||
const ti1 = getTeacherInvitation01();
|
||||
const ti2 = getTeacherInvitation02();
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsBy(teacher!);
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsBy(teacher);
|
||||
|
||||
expect(invitations).toBeTruthy();
|
||||
expect(invitations).toHaveLength(2);
|
||||
|
@ -30,7 +30,7 @@ describe('ClassRepository', () => {
|
|||
const teacher = getFooFighters();
|
||||
const ti1 = getTeacherInvitation01();
|
||||
const ti2 = getTeacherInvitation03();
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsFor(teacher!);
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsFor(teacher);
|
||||
|
||||
expect(invitations).toBeTruthy();
|
||||
expect(invitations).toHaveLength(2);
|
||||
|
@ -42,7 +42,7 @@ describe('ClassRepository', () => {
|
|||
const class_ = getClass02();
|
||||
const ti1 = getTeacherInvitation01();
|
||||
const ti2 = getTeacherInvitation02();
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsForClass(class_!);
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsForClass(class_);
|
||||
|
||||
expect(invitations).toBeTruthy();
|
||||
expect(invitations).toHaveLength(2);
|
||||
|
@ -55,9 +55,9 @@ describe('ClassRepository', () => {
|
|||
const class_ = getClass01();
|
||||
const sender = getFooFighters();
|
||||
const receiver = getLimpBizkit();
|
||||
await teacherInvitationRepository.deleteBy(class_!, sender!, receiver!);
|
||||
await teacherInvitationRepository.deleteBy(class_, sender, receiver);
|
||||
|
||||
const invitation = await teacherInvitationRepository.findAllInvitationsBy(sender!);
|
||||
const invitation = await teacherInvitationRepository.findAllInvitationsBy(sender);
|
||||
|
||||
expect(invitation).toHaveLength(0);
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ describe('LearningObjectRepository', () => {
|
|||
let newerExample: LearningObject;
|
||||
|
||||
it('should allow a learning object with the same id except a different version to be added', async () => {
|
||||
// structeredClone failed on teacher, this copies all fields to a json object
|
||||
// StructeredClone failed on teacher, this copies all fields to a json object
|
||||
const testLearningObject01Newer = { ...testLearningObject01 };
|
||||
testLearningObject01Newer.version = 10;
|
||||
testLearningObject01Newer.title += ' (nieuw)';
|
||||
|
@ -52,9 +52,9 @@ describe('LearningObjectRepository', () => {
|
|||
|
||||
|
||||
const result = await learningObjectRepository.findLatestByHruidAndLanguage(newerExample.hruid, newerExample.language);
|
||||
// expect(result).toBeInstanceOf(LearningObject);
|
||||
// expect(result?.version).toBe(10);
|
||||
// expect(result?.title).toContain('(nieuw)');
|
||||
// Expect(result).toBeInstanceOf(LearningObject);
|
||||
// Expect(result?.version).toBe(10);
|
||||
// Expect(result?.title).toContain('(nieuw)');
|
||||
});
|
||||
|
||||
it('should return null when queried by non-existing hruid or language', async () => {
|
||||
|
|
|
@ -24,7 +24,7 @@ describe('AnswerRepository', () => {
|
|||
const a1 = getAnswer01();
|
||||
const a2 = getAnswer02();
|
||||
|
||||
const answers = await answerRepository.findAllAnswersToQuestion(question!);
|
||||
const answers = await answerRepository.findAllAnswersToQuestion(question);
|
||||
|
||||
expect(answers).toBeTruthy();
|
||||
expect(answers).toHaveLength(2);
|
||||
|
@ -38,7 +38,7 @@ describe('AnswerRepository', () => {
|
|||
|
||||
await answerRepository.createAnswer({
|
||||
toQuestion: question,
|
||||
author: teacher!,
|
||||
author: teacher,
|
||||
content: 'created answer',
|
||||
});
|
||||
|
||||
|
|
|
@ -48,8 +48,8 @@ describe('QuestionRepository', () => {
|
|||
const group = getTestGroup01();
|
||||
await questionRepository.createQuestion({
|
||||
loId: id,
|
||||
inGroup: group!,
|
||||
author: student!,
|
||||
inGroup: group,
|
||||
author: student,
|
||||
content: 'question?',
|
||||
});
|
||||
const question = await questionRepository.findAllQuestionsAboutLearningObject(id);
|
||||
|
@ -66,7 +66,7 @@ describe('QuestionRepository', () => {
|
|||
language: testLearningObject05.language,
|
||||
version: testLearningObject05.version,
|
||||
};
|
||||
const result = await questionRepository.findAllQuestionsAboutLearningObjectInAssignment(loId, assignment!);
|
||||
const result = await questionRepository.findAllQuestionsAboutLearningObjectInAssignment(loId, assignment);
|
||||
sortQuestions(result);
|
||||
|
||||
expect(result).toHaveLength(3);
|
||||
|
@ -94,7 +94,7 @@ describe('QuestionRepository', () => {
|
|||
};
|
||||
const assignment = getAssignment01();
|
||||
|
||||
const result = await questionRepository.findAllQuestionsAboutLearningObjectInAssignment(loId, assignment!, getTool().username);
|
||||
const result = await questionRepository.findAllQuestionsAboutLearningObjectInAssignment(loId, assignment, getTool().username);
|
||||
// (student Tool is in group #2)
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue