Added missing parameter fro negative-test

ref #78
This commit is contained in:
Nicolai Ort 2021-01-09 16:54:19 +01:00
parent f1dee1061d
commit 4fea690670
1 changed files with 12 additions and 2 deletions

View File

@ -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);
});
});