| @@ -33,6 +33,17 @@ describe('POST /api/tracks', () => { | ||||
| 		expect(res.status).toEqual(200); | ||||
| 		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 () => { | ||||
| 		const res = await axios.get('http://localhost:4010/api/tracks'); | ||||
| 		expect(res.status).toEqual(200); | ||||
| @@ -41,7 +52,7 @@ describe('POST /api/tracks', () => { | ||||
| 		delete added_track.id | ||||
| 		expect(added_track).toEqual({ | ||||
| 			"name": "string", | ||||
| 			"distance": 400 | ||||
| 			"distance": 1000 | ||||
| 		}) | ||||
| 	}); | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user