Added selfservice get positive test

ref #112
This commit is contained in:
Nicolai Ort 2021-01-21 19:17:25 +01:00
parent 1227408407
commit 0c87906cc3
1 changed files with 20 additions and 1 deletions

View File

@ -21,4 +21,23 @@ describe('GET /api/runners/me invalid should return fail', () => {
expect(res.headers['content-type']).toContain("application/json");
});
});
// ---------------
// ---------------
describe('register + get should return 200', () => {
let added_runner;
it('registering as citizen should return 200', async () => {
const res = await axios.post(base + '/api/runners/register', {
"firstname": "string",
"middlename": "string",
"lastname": "string",
"email": "user@example.com"
}, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
added_runner = res.data;
});
it('get with valid jwt should return 200', async () => {
const res = await axios.get(base + '/api/runners/me/' + added_runner.token, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
});
});