parent
15e3d04215
commit
a671bf8bcb
@ -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
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user