style: fix linting issues met Prettier
This commit is contained in:
parent
e58835aa17
commit
e73d5c21c3
34 changed files with 103 additions and 296 deletions
|
@ -1,11 +1,7 @@
|
|||
import { beforeAll, describe, expect, it } from 'vitest';
|
||||
import { setupTestApp } from '../../setup-tests';
|
||||
import { ClassJoinRequestRepository } from '../../../src/data/classes/class-join-request-repository';
|
||||
import {
|
||||
getClassJoinRequestRepository,
|
||||
getClassRepository,
|
||||
getStudentRepository,
|
||||
} from '../../../src/data/repositories';
|
||||
import { getClassJoinRequestRepository, getClassRepository, getStudentRepository } from '../../../src/data/repositories';
|
||||
import { StudentRepository } from '../../../src/data/users/student-repository';
|
||||
import { Class } from '../../../src/entities/classes/class.entity';
|
||||
import { ClassRepository } from '../../../src/data/classes/class-repository';
|
||||
|
@ -25,9 +21,7 @@ describe('ClassJoinRequestRepository', () => {
|
|||
|
||||
it('should list all requests from student to join classes', async () => {
|
||||
const student = await studentRepository.findByUsername('PinkFloyd');
|
||||
const requests = await classJoinRequestRepository.findAllRequestsBy(
|
||||
student!
|
||||
);
|
||||
const requests = await classJoinRequestRepository.findAllRequestsBy(student!);
|
||||
|
||||
expect(requests).toBeTruthy();
|
||||
expect(requests).toHaveLength(2);
|
||||
|
@ -35,23 +29,18 @@ describe('ClassJoinRequestRepository', () => {
|
|||
|
||||
it('should list all requests to a single class', async () => {
|
||||
const class_ = await cassRepository.findById('id02');
|
||||
const requests = await classJoinRequestRepository.findAllOpenRequestsTo(
|
||||
class_!
|
||||
);
|
||||
const requests = await classJoinRequestRepository.findAllOpenRequestsTo(class_!);
|
||||
|
||||
expect(requests).toBeTruthy();
|
||||
expect(requests).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('should not find a removed request', async () => {
|
||||
const student =
|
||||
await studentRepository.findByUsername('SmashingPumpkins');
|
||||
const student = await studentRepository.findByUsername('SmashingPumpkins');
|
||||
const class_ = await cassRepository.findById('id03');
|
||||
await classJoinRequestRepository.deleteBy(student!, class_!);
|
||||
|
||||
const request = await classJoinRequestRepository.findAllRequestsBy(
|
||||
student!
|
||||
);
|
||||
const request = await classJoinRequestRepository.findAllRequestsBy(student!);
|
||||
|
||||
expect(request).toHaveLength(0);
|
||||
});
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import { beforeAll, describe, expect, it } from 'vitest';
|
||||
import { setupTestApp } from '../../setup-tests';
|
||||
import {
|
||||
getClassRepository,
|
||||
getTeacherInvitationRepository,
|
||||
getTeacherRepository,
|
||||
} from '../../../src/data/repositories';
|
||||
import { getClassRepository, getTeacherInvitationRepository, getTeacherRepository } from '../../../src/data/repositories';
|
||||
import { TeacherInvitationRepository } from '../../../src/data/classes/teacher-invitation-repository';
|
||||
import { TeacherRepository } from '../../../src/data/users/teacher-repository';
|
||||
import { ClassRepository } from '../../../src/data/classes/class-repository';
|
||||
|
@ -23,8 +19,7 @@ describe('ClassRepository', () => {
|
|||
|
||||
it('should return all invitations from a teacher', async () => {
|
||||
const teacher = await teacherRepository.findByUsername('LimpBizkit');
|
||||
const invitations =
|
||||
await teacherInvitationRepository.findAllInvitationsBy(teacher!);
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsBy(teacher!);
|
||||
|
||||
expect(invitations).toBeTruthy();
|
||||
expect(invitations).toHaveLength(2);
|
||||
|
@ -32,8 +27,7 @@ describe('ClassRepository', () => {
|
|||
|
||||
it('should return all invitations for a teacher', async () => {
|
||||
const teacher = await teacherRepository.findByUsername('FooFighters');
|
||||
const invitations =
|
||||
await teacherInvitationRepository.findAllInvitationsFor(teacher!);
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsFor(teacher!);
|
||||
|
||||
expect(invitations).toBeTruthy();
|
||||
expect(invitations).toHaveLength(2);
|
||||
|
@ -41,10 +35,7 @@ describe('ClassRepository', () => {
|
|||
|
||||
it('should return all invitations for a class', async () => {
|
||||
const class_ = await classRepository.findById('id02');
|
||||
const invitations =
|
||||
await teacherInvitationRepository.findAllInvitationsForClass(
|
||||
class_!
|
||||
);
|
||||
const invitations = await teacherInvitationRepository.findAllInvitationsForClass(class_!);
|
||||
|
||||
expect(invitations).toBeTruthy();
|
||||
expect(invitations).toHaveLength(2);
|
||||
|
@ -56,8 +47,7 @@ describe('ClassRepository', () => {
|
|||
const receiver = await teacherRepository.findByUsername('LimpBizkit');
|
||||
await teacherInvitationRepository.deleteBy(class_!, sender!, receiver!);
|
||||
|
||||
const invitation =
|
||||
await teacherInvitationRepository.findAllInvitationsBy(sender!);
|
||||
const invitation = await teacherInvitationRepository.findAllInvitationsBy(sender!);
|
||||
|
||||
expect(invitation).toHaveLength(0);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue