Added registration valid citizentests

ref #112
This commit is contained in:
Nicolai Ort 2021-01-21 19:33:55 +01:00
parent 81d2197a3e
commit 72941da1cb
1 changed files with 30 additions and 0 deletions

View File

@ -64,3 +64,33 @@ describe('register invalid citizen', () => {
expect(res.headers['content-type']).toContain("application/json");
});
});
// ---------------
describe('register citizen valid', () => {
it('registering as citizen with minimal params should return 200', async () => {
const res = await axios.post(base + '/api/runners/register', {
"firstname": "string",
"lastname": "string",
"email": "user@example.com"
}, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
});
it('registering as citizen with all params should return 200', async () => {
const res = await axios.post(base + '/api/runners/register', {
"firstname": "string",
"middlename": "string",
"lastname": "string",
"email": "user@example.com",
"phone": "+4909132123456",
"address": {
address1: "Teststreet 1",
address2: "Testapartement",
postalcode: "91074",
city: "Herzo",
country: "Germany"
}
}, axios_config);
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json");
});
});