style: fix linting issues met Prettier
This commit is contained in:
parent
447aeee9f3
commit
63045c4223
2 changed files with 6 additions and 9 deletions
|
@ -5,12 +5,13 @@ import {
|
||||||
createInvitationHandler,
|
createInvitationHandler,
|
||||||
deleteInvitationHandler,
|
deleteInvitationHandler,
|
||||||
getAllInvitationsHandler,
|
getAllInvitationsHandler,
|
||||||
getInvitationHandler, updateInvitationHandler
|
getInvitationHandler,
|
||||||
|
updateInvitationHandler,
|
||||||
} from '../../src/controllers/teacher-invitations';
|
} from '../../src/controllers/teacher-invitations';
|
||||||
import { TeacherInvitationData } from '@dwengo-1/common/interfaces/teacher-invitation';
|
import { TeacherInvitationData } from '@dwengo-1/common/interfaces/teacher-invitation';
|
||||||
import { getClassHandler } from '../../src/controllers/classes';
|
import { getClassHandler } from '../../src/controllers/classes';
|
||||||
import {BadRequestException} from "../../src/exceptions/bad-request-exception";
|
import { BadRequestException } from '../../src/exceptions/bad-request-exception';
|
||||||
import {ClassStatus} from "@dwengo-1/common/util/class-join-request";
|
import { ClassStatus } from '@dwengo-1/common/util/class-join-request';
|
||||||
|
|
||||||
describe('Teacher controllers', () => {
|
describe('Teacher controllers', () => {
|
||||||
let req: Partial<Request>;
|
let req: Partial<Request>;
|
||||||
|
@ -92,11 +93,9 @@ describe('Teacher controllers', () => {
|
||||||
params: { no: 'no params' },
|
params: { no: 'no params' },
|
||||||
};
|
};
|
||||||
|
|
||||||
await expect( async () => getInvitationHandler(req as Request, res as Response))
|
await expect(async () => getInvitationHandler(req as Request, res as Response)).rejects.toThrowError(BadRequestException);
|
||||||
.rejects.toThrowError(BadRequestException);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('Accept invitation', async () => {
|
it('Accept invitation', async () => {
|
||||||
const body = {
|
const body = {
|
||||||
sender: 'LimpBizkit',
|
sender: 'LimpBizkit',
|
||||||
|
@ -121,6 +120,4 @@ describe('Teacher controllers', () => {
|
||||||
const result = jsonMock.mock.lastCall?.[0];
|
const result = jsonMock.mock.lastCall?.[0];
|
||||||
expect(result.class.teachers).toContain('FooFighters');
|
expect(result.class.teachers).toContain('FooFighters');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,7 +19,7 @@ export class TeacherInvitationController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
async getBy(data: TeacherInvitationData): Promise<TeacherInvitationResponse> {
|
async getBy(data: TeacherInvitationData): Promise<TeacherInvitationResponse> {
|
||||||
return this.get<TeacherInvitationResponse>(`/${data.sender}/${data.receiver}/${data.class}`)
|
return this.get<TeacherInvitationResponse>(`/${data.sender}/${data.receiver}/${data.class}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async create(data: TeacherInvitationData): Promise<TeacherInvitationResponse> {
|
async create(data: TeacherInvitationData): Promise<TeacherInvitationResponse> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue