parent
6eee80d357
commit
d295100a48
@ -2,14 +2,6 @@ import axios from 'axios';
|
|||||||
import { config } from '../../config';
|
import { config } from '../../config';
|
||||||
const base = "http://localhost:" + config.internal_port
|
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/organisations', () => {
|
describe('POST /api/organisations', () => {
|
||||||
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 res = await axios.post(base + '/api/organisations', {
|
const res = await axios.post(base + '/api/organisations', {
|
19
src/tests/runnerOrgs/org_get.spec.ts
Normal file
19
src/tests/runnerOrgs/org_get.spec.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
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('GET /api/organisations/0', () => {
|
||||||
|
it('basic get should return 404', async () => {
|
||||||
|
const res = await axios.get(base + '/api/runners/0', { validateStatus: undefined });
|
||||||
|
expect(res.status).toEqual(404);
|
||||||
|
expect(res.headers['content-type']).toContain("application/json")
|
||||||
|
});
|
||||||
|
});
|
19
src/tests/runnerTeams/team_get.spec.ts
Normal file
19
src/tests/runnerTeams/team_get.spec.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
import { config } from '../../config';
|
||||||
|
const base = "http://localhost:" + config.internal_port
|
||||||
|
|
||||||
|
describe('GET /api/teams', () => {
|
||||||
|
it('basic get should return 200', async () => {
|
||||||
|
const res = await axios.get(base + '/api/teams');
|
||||||
|
expect(res.status).toEqual(200);
|
||||||
|
expect(res.headers['content-type']).toContain("application/json")
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// ---------------
|
||||||
|
describe('GET /api/teams/0', () => {
|
||||||
|
it('basic get should return 404', async () => {
|
||||||
|
const res = await axios.get(base + '/api/teams/0', { validateStatus: undefined });
|
||||||
|
expect(res.status).toEqual(404);
|
||||||
|
expect(res.headers['content-type']).toContain("application/json")
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user