@@ -137,7 +137,8 @@ describe('POST /api/scans successfully', () => {
 | 
				
			|||||||
	it('creating a track should return 200', async () => {
 | 
						it('creating a track should return 200', async () => {
 | 
				
			||||||
		const res1 = await axios.post(base + '/api/tracks', {
 | 
							const res1 = await axios.post(base + '/api/tracks', {
 | 
				
			||||||
			"name": "test123",
 | 
								"name": "test123",
 | 
				
			||||||
			"distance": 123
 | 
								"distance": 123,
 | 
				
			||||||
 | 
								"minimumLapTime": 30
 | 
				
			||||||
		}, axios_config);
 | 
							}, axios_config);
 | 
				
			||||||
		added_track = res1.data
 | 
							added_track = res1.data
 | 
				
			||||||
		expect(res1.status).toEqual(200);
 | 
							expect(res1.status).toEqual(200);
 | 
				
			||||||
@@ -160,6 +161,15 @@ describe('POST /api/scans successfully', () => {
 | 
				
			|||||||
		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");
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
						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', () => {
 | 
					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.status).toEqual(200);
 | 
				
			||||||
		expect(res.headers['content-type']).toContain("application/json");
 | 
							expect(res.headers['content-type']).toContain("application/json");
 | 
				
			||||||
		expect(res.data.vaild).toEqual(false);
 | 
							expect(res.data.valid).toEqual(false);
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
		Reference in New Issue
	
	Block a user