diff --git a/src/tests/trackscans/trackscans_add.spec.ts b/src/tests/trackscans/trackscans_add.spec.ts index 4b5de54..a4b475d 100644 --- a/src/tests/trackscans/trackscans_add.spec.ts +++ b/src/tests/trackscans/trackscans_add.spec.ts @@ -137,7 +137,8 @@ describe('POST /api/scans successfully', () => { it('creating a track should return 200', async () => { const res1 = await axios.post(base + '/api/tracks', { "name": "test123", - "distance": 123 + "distance": 123, + "minimumLapTime": 30 }, axios_config); added_track = res1.data expect(res1.status).toEqual(200); @@ -160,6 +161,15 @@ describe('POST /api/scans successfully', () => { expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json"); }); + it('creating a invalid scan should return 200', async () => { + const res = await axios.post(base + '/api/scans/trackscans', { + "card": added_card.id, + "station": added_station.id + }, axios_config); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json"); + expect(res.data.valid).toEqual(false); + }); }); // --------------- describe('POST /api/scans successfully via scan station', () => { @@ -234,6 +244,6 @@ describe('POST /api/scans successfully via scan station', () => { }); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json"); - expect(res.data.vaild).toEqual(false); + expect(res.data.valid).toEqual(false); }); }); \ No newline at end of file