diff --git a/src/tests/runnerGroups/org.spec.ts b/src/tests/runnerGroups/org.spec.ts new file mode 100644 index 0000000..e5387ea --- /dev/null +++ b/src/tests/runnerGroups/org.spec.ts @@ -0,0 +1,28 @@ +import axios from 'axios'; +import { config } from '../../config'; +const base = "http://localhost:" + config.internal_port + +describe('GET /api/organisations', () => { + it('basic get should return 200', async () => { + const res = await axios.get(base + '/api/organisations'); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json") + }); +}); +// --------------- +describe('POST /api/organisation', () => { + it('creating a new org with just a name should return 200', async () => { + const res = await axios.post(base + '/api/organisation', { + "name": "test123" + }); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json") + }); + it('creating a new org with without a name should return 400', async () => { + const res = await axios.post(base + '/api/organisation', { + "name": null + }); + expect(res.status).toEqual(400); + expect(res.headers['content-type']).toContain("application/json") + }); +}); \ No newline at end of file