Merge branch 'dev' into feat/discussions
This commit is contained in:
commit
e28a57754f
44 changed files with 2270 additions and 767 deletions
|
@ -14,6 +14,7 @@ import {
|
|||
getStudentRequestsHandler,
|
||||
deleteClassJoinRequestHandler,
|
||||
getStudentRequestHandler,
|
||||
getStudentAssignmentsHandler,
|
||||
} from '../../src/controllers/students.js';
|
||||
import { getDireStraits, getNoordkaap, getTheDoors, TEST_STUDENTS } from '../test_assets/users/students.testdata.js';
|
||||
import { NotFoundException } from '../../src/exceptions/not-found-exception.js';
|
||||
|
@ -150,6 +151,19 @@ describe('Student controllers', () => {
|
|||
expect(result.groups).to.have.length.greaterThan(0);
|
||||
});
|
||||
|
||||
it('Student assignments', async () => {
|
||||
const group = getTestGroup01();
|
||||
const member = group.members[0];
|
||||
req = { params: { username: member.username }, query: {} };
|
||||
|
||||
await getStudentAssignmentsHandler(req as Request, res as Response);
|
||||
|
||||
expect(jsonMock).toHaveBeenCalledWith(expect.objectContaining({ assignments: expect.anything() }));
|
||||
|
||||
const result = jsonMock.mock.lastCall?.[0];
|
||||
expect(result.assignments).to.have.length.greaterThan(0);
|
||||
});
|
||||
|
||||
it('Student submissions', async () => {
|
||||
const submission = getSubmission01();
|
||||
req = { params: { username: submission.submitter.username }, query: { full: 'true' } };
|
||||
|
|
|
@ -51,7 +51,7 @@ export function makeTestGroups(em: EntityManager): Group[] {
|
|||
*/
|
||||
group05 = em.create(Group, {
|
||||
assignment: getAssignment04(),
|
||||
groupNumber: 21001,
|
||||
groupNumber: 21006,
|
||||
members: [getNoordkaap(), getDireStraits()],
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue