ref #17
This commit is contained in:
Nicolai Ort 2020-12-09 19:57:02 +01:00
parent 71e5be2ba4
commit 6e316a7533
3 changed files with 88 additions and 97 deletions

View File

@ -6,7 +6,6 @@ const base = "http://localhost:" + config.internal_port
describe('adding + deletion (successfull)', () => { describe('adding + deletion (successfull)', () => {
let added_org_id let added_org_id
let added_org let added_org
describe('adding org', () => {
it('creating a new org with just a name should return 200', async () => { it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', { const res1 = await axios.post(base + '/api/organisations', {
"name": "test123" "name": "test123"
@ -35,13 +34,11 @@ describe('adding + deletion (successfull)', () => {
expect(res3.status).toEqual(404); expect(res3.status).toEqual(404);
expect(res3.headers['content-type']).toContain("application/json") expect(res3.headers['content-type']).toContain("application/json")
}); });
});
}); });
// --------------- // ---------------
describe('adding + deletion (non-existant)', () => { describe('adding + deletion (non-existant)', () => {
it('delete', async () => { it('delete', async () => {
const res2 = await axios.delete(base + '/api/organisations/0', { validateStatus: undefined }); const res2 = await axios.delete(base + '/api/organisations/0', { validateStatus: undefined });
expect(res2.status).toEqual(204); expect(res2.status).toEqual(204);
expect(res2.headers['content-type']).toContain("application/json")
}); });
}); });

View File

@ -52,7 +52,6 @@ describe('adding + getting from all orgs', () => {
// --------------- // ---------------
describe('adding + getting explicitly', () => { describe('adding + getting explicitly', () => {
let added_org_id let added_org_id
describe('adding + getting orgs', () => {
it('creating a new org with just a name should return 200', async () => { it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', { const res1 = await axios.post(base + '/api/organisations', {
"name": "test123" "name": "test123"
@ -76,5 +75,4 @@ describe('adding + getting explicitly', () => {
"teams": [] "teams": []
}) })
}); });
});
}); });

View File

@ -6,7 +6,6 @@ const base = "http://localhost:" + config.internal_port
describe('adding + updating name', () => { describe('adding + updating name', () => {
let added_org_id let added_org_id
let added_org let added_org
describe('adding org', () => {
it('creating a new org with just a name should return 200', async () => { it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', { const res1 = await axios.post(base + '/api/organisations', {
"name": "test123" "name": "test123"
@ -35,13 +34,11 @@ describe('adding + updating name', () => {
"teams": [] "teams": []
}) })
}); });
});
}); });
// --------------- // ---------------
describe('adding + try updating id (should return 406)', () => { describe('adding + try updating id (should return 406)', () => {
let added_org_id let added_org_id
let added_org let added_org
describe('adding org', () => {
it('creating a new org with just a name should return 200', async () => { it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', { const res1 = await axios.post(base + '/api/organisations', {
"name": "test123" "name": "test123"
@ -61,5 +58,4 @@ describe('adding + try updating id (should return 406)', () => {
expect(res2.status).toEqual(406); expect(res2.status).toEqual(406);
expect(res2.headers['content-type']).toContain("application/json") expect(res2.headers['content-type']).toContain("application/json")
}); });
});
}); });