parent
862834c877
commit
b4b52717fc
@ -11,20 +11,28 @@ describe('GET /api/teams', () => {
|
|||||||
});
|
});
|
||||||
// ---------------
|
// ---------------
|
||||||
describe('POST /api/teams with errors', () => {
|
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', {
|
const res1 = await axios.post(base + '/api/teams', {
|
||||||
"name": "test_team"
|
"name": null
|
||||||
}, { validateStatus: undefined });
|
}, { validateStatus: undefined });
|
||||||
expect(res1.status).toEqual(400);
|
expect(res1.status).toEqual(400);
|
||||||
expect(res1.headers['content-type']).toContain("application/json")
|
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', {
|
const res2 = await axios.post(base + '/api/teams', {
|
||||||
"name": null
|
"name": "test_team"
|
||||||
}, { validateStatus: undefined });
|
}, { validateStatus: undefined });
|
||||||
expect(res2.status).toEqual(400);
|
expect(res2.status).toEqual(400);
|
||||||
expect(res2.headers['content-type']).toContain("application/json")
|
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', () => {
|
describe('POST /api/teams working', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user