Merge remote-tracking branch 'origin/feat/user-routes' into feat/user-routes
# Conflicts: # backend/src/interfaces/answer.ts # backend/src/services/questions.ts # frontend/src/controllers/students.ts # frontend/src/controllers/teachers.ts # frontend/src/queries/students.ts # frontend/src/queries/teachers.ts
This commit is contained in:
commit
87366b2821
7 changed files with 23 additions and 41 deletions
|
@ -46,15 +46,13 @@ describe('Teacher controllers', () => {
|
|||
it('Teacher not found', async () => {
|
||||
req = { params: { username: 'doesnotexist' } };
|
||||
|
||||
await expect(async () => getTeacherHandler(req as Request, res as Response))
|
||||
.rejects.toThrow(NotFoundException);
|
||||
await expect(async () => getTeacherHandler(req as Request, res as Response)).rejects.toThrow(NotFoundException);
|
||||
});
|
||||
|
||||
it('No username', async () => {
|
||||
req = { params: {} };
|
||||
|
||||
await expect(async () => getTeacherHandler(req as Request, res as Response))
|
||||
.rejects.toThrowError(BadRequestException);
|
||||
await expect(async () => getTeacherHandler(req as Request, res as Response)).rejects.toThrowError(BadRequestException);
|
||||
});
|
||||
|
||||
it('Create and delete teacher', async () => {
|
||||
|
@ -63,7 +61,7 @@ describe('Teacher controllers', () => {
|
|||
username: 'coolteacher',
|
||||
firstName: 'New',
|
||||
lastName: 'Teacher',
|
||||
}
|
||||
};
|
||||
req = {
|
||||
body: teacher,
|
||||
};
|
||||
|
@ -88,15 +86,13 @@ describe('Teacher controllers', () => {
|
|||
},
|
||||
};
|
||||
|
||||
await expect(async () => createTeacherHandler(req as Request, res as Response))
|
||||
.rejects.toThrowError(EntityAlreadyExistsException);
|
||||
await expect(async () => createTeacherHandler(req as Request, res as Response)).rejects.toThrowError(EntityAlreadyExistsException);
|
||||
});
|
||||
|
||||
it('Create teacher no body', async () => {
|
||||
req = { body: {} };
|
||||
|
||||
await expect(async () => createTeacherHandler(req as Request, res as Response))
|
||||
.rejects.toThrowError(BadRequestException);
|
||||
await expect(async () => createTeacherHandler(req as Request, res as Response)).rejects.toThrowError(BadRequestException);
|
||||
});
|
||||
|
||||
it('Teacher list', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue