test: alle testen slagen na aanpassen testdata
This commit is contained in:
parent
1ff6405066
commit
a5e82858ab
8 changed files with 23 additions and 23 deletions
|
@ -186,7 +186,7 @@ describe('Student controllers', () => {
|
|||
|
||||
it('Get join request by student and class', async () => {
|
||||
req = {
|
||||
params: { username: 'PinkFloyd', classId: 'id02' },
|
||||
params: { username: 'PinkFloyd', classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89' },
|
||||
};
|
||||
|
||||
await getStudentRequestHandler(req as Request, res as Response);
|
||||
|
@ -201,7 +201,7 @@ describe('Student controllers', () => {
|
|||
it('Create join request', async () => {
|
||||
req = {
|
||||
params: { username: 'Noordkaap' },
|
||||
body: { classId: 'id02' },
|
||||
body: { classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89' },
|
||||
};
|
||||
|
||||
await createStudentRequestHandler(req as Request, res as Response);
|
||||
|
@ -212,7 +212,7 @@ describe('Student controllers', () => {
|
|||
it('Create join request duplicate', async () => {
|
||||
req = {
|
||||
params: { username: 'Tool' },
|
||||
body: { classId: 'id02' },
|
||||
body: { classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89' },
|
||||
};
|
||||
|
||||
await expect(async () => createStudentRequestHandler(req as Request, res as Response)).rejects.toThrow(ConflictException);
|
||||
|
@ -220,7 +220,7 @@ describe('Student controllers', () => {
|
|||
|
||||
it('Delete join request', async () => {
|
||||
req = {
|
||||
params: { username: 'Noordkaap', classId: 'id02' },
|
||||
params: { username: 'Noordkaap', classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89' },
|
||||
};
|
||||
|
||||
await deleteClassJoinRequestHandler(req as Request, res as Response);
|
||||
|
|
|
@ -104,9 +104,9 @@ describe('Teacher controllers', () => {
|
|||
const result = jsonMock.mock.lastCall?.[0];
|
||||
|
||||
const teacherUsernames = result.teachers.map((s: TeacherDTO) => s.username);
|
||||
expect(teacherUsernames).toContain('FooFighters');
|
||||
expect(teacherUsernames).toContain('testleerkracht1');
|
||||
|
||||
expect(result.teachers).toHaveLength(4);
|
||||
expect(result.teachers).toHaveLength(5);
|
||||
});
|
||||
|
||||
it('Deleting non-existent student', async () => {
|
||||
|
@ -117,7 +117,7 @@ describe('Teacher controllers', () => {
|
|||
|
||||
it('Get teacher classes', async () => {
|
||||
req = {
|
||||
params: { username: 'FooFighters' },
|
||||
params: { username: 'testleerkracht1' },
|
||||
query: { full: 'true' },
|
||||
};
|
||||
|
||||
|
@ -132,7 +132,7 @@ describe('Teacher controllers', () => {
|
|||
|
||||
it('Get teacher students', async () => {
|
||||
req = {
|
||||
params: { username: 'FooFighters' },
|
||||
params: { username: 'testleerkracht1' },
|
||||
query: { full: 'true' },
|
||||
};
|
||||
|
||||
|
@ -169,7 +169,7 @@ describe('Teacher controllers', () => {
|
|||
it('Get join requests by class', async () => {
|
||||
req = {
|
||||
query: { username: 'LimpBizkit' },
|
||||
params: { classId: 'id02' },
|
||||
params: { classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89' },
|
||||
};
|
||||
|
||||
await getStudentJoinRequestHandler(req as Request, res as Response);
|
||||
|
@ -184,7 +184,7 @@ describe('Teacher controllers', () => {
|
|||
it('Update join request status', async () => {
|
||||
req = {
|
||||
query: { username: 'LimpBizkit', studentUsername: 'PinkFloyd' },
|
||||
params: { classId: 'id02' },
|
||||
params: { classId: '34d484a1-295f-4e9f-bfdc-3e7a23d86a89' },
|
||||
body: { accepted: 'true' },
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue