fix: student join req by class route + teacher return post put delete + status
This commit is contained in:
parent
c0995d3933
commit
912369f87e
9 changed files with 106 additions and 47 deletions
|
@ -11,8 +11,8 @@ import {
|
|||
getStudentSubmissionsHandler,
|
||||
getStudentQuestionsHandler,
|
||||
createStudentRequestHandler,
|
||||
getStudentRequestHandler,
|
||||
deleteClassJoinRequestHandler,
|
||||
getStudentRequestsHandler,
|
||||
deleteClassJoinRequestHandler, getStudentRequestHandler,
|
||||
} from '../../src/controllers/students.js';
|
||||
import { TEST_STUDENTS } from '../test_assets/users/students.testdata.js';
|
||||
import { NotFoundException } from '../../src/exceptions/not-found-exception.js';
|
||||
|
@ -176,7 +176,7 @@ describe('Student controllers', () => {
|
|||
params: { username: 'PinkFloyd' },
|
||||
};
|
||||
|
||||
await getStudentRequestHandler(req as Request, res as Response);
|
||||
await getStudentRequestsHandler(req as Request, res as Response);
|
||||
|
||||
expect(jsonMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
|
@ -189,6 +189,20 @@ describe('Student controllers', () => {
|
|||
expect(result.requests.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('Get join request by student', async () => {
|
||||
req = {
|
||||
params: { username: 'PinkFloyd', classId: 'id02' },
|
||||
};
|
||||
|
||||
await getStudentRequestHandler(req as Request, res as Response);
|
||||
|
||||
expect(jsonMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
request: expect.anything(),
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('Create join request', async () => {
|
||||
req = {
|
||||
params: { username: 'Noordkaap' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue