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)', () => {
let added_org_id
let added_org
describe('adding org', () => {
it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', {
"name": "test123"
@ -36,12 +35,10 @@ describe('adding + deletion (successfull)', () => {
expect(res3.headers['content-type']).toContain("application/json")
});
});
});
// ---------------
describe('adding + deletion (non-existant)', () => {
it('delete', async () => {
const res2 = await axios.delete(base + '/api/organisations/0', { validateStatus: undefined });
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', () => {
let added_org_id
describe('adding + getting orgs', () => {
it('creating a new org with just a name should return 200', async () => {
const res1 = await axios.post(base + '/api/organisations', {
"name": "test123"
@ -77,4 +76,3 @@ describe('adding + getting explicitly', () => {
})
});
});
});

View File

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