feature/17-automated_tests #21

Merged
niggl merged 56 commits from feature/17-automated_tests into dev 2020-12-10 19:36:08 +00:00
Showing only changes of commit a671bf8bcb - Show all commits

View File

@ -33,6 +33,17 @@ describe('POST /api/tracks', () => {
expect(res.status).toEqual(200); expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json") expect(res.headers['content-type']).toContain("application/json")
}); });
});
// ---------------
describe('adding + getting tracks', () => {
it('correct distance input should return 200', async () => {
const res = await axios.post('http://localhost:4010/api/tracks', {
"name": "string",
"distance": 1000
});
expect(res.status).toEqual(200);
expect(res.headers['content-type']).toContain("application/json")
});
it('check if track was added', async () => { it('check if track was added', async () => {
const res = await axios.get('http://localhost:4010/api/tracks'); const res = await axios.get('http://localhost:4010/api/tracks');
expect(res.status).toEqual(200); expect(res.status).toEqual(200);
@ -41,7 +52,7 @@ describe('POST /api/tracks', () => {
delete added_track.id delete added_track.id
expect(added_track).toEqual({ expect(added_track).toEqual({
"name": "string", "name": "string",
"distance": 400 "distance": 1000
}) })
}); });
}); });