diff --git a/src/tests/runnerTeams/team_add+get.spec.ts b/src/tests/runnerTeams/team_add+get.spec.ts index 69d85ed..79505ad 100644 --- a/src/tests/runnerTeams/team_add+get.spec.ts +++ b/src/tests/runnerTeams/team_add+get.spec.ts @@ -11,20 +11,28 @@ describe('GET /api/teams', () => { }); // --------------- describe('POST /api/teams with errors', () => { - it('creating a new org with without a team should return 400', async () => { + it('creating a new team without a name should return 400', async () => { const res1 = await axios.post(base + '/api/teams', { - "name": "test_team" + "name": null }, { validateStatus: undefined }); expect(res1.status).toEqual(400); expect(res1.headers['content-type']).toContain("application/json") }); - it('creating a new org with without a name should return 400', async () => { + it('creating a new team without a org should return 400', async () => { const res2 = await axios.post(base + '/api/teams', { - "name": null + "name": "test_team" }, { validateStatus: undefined }); expect(res2.status).toEqual(400); expect(res2.headers['content-type']).toContain("application/json") }); + it('creating a new team without a valid org should return 404', async () => { + const res3 = await axios.post(base + '/api/teams', { + "name": "test_team", + "parentGroup": -1 + }, { validateStatus: undefined }); + expect(res3.status).toEqual(404); + expect(res3.headers['content-type']).toContain("application/json") + }); }); // --------------- describe('POST /api/teams working', () => {