From 26dff4f41829e8571231aff3c5d0e3a7c53559d8 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 21 Jan 2021 16:07:11 +0100 Subject: [PATCH] Added get tests for the /runner/scans endpoint ref #113 --- src/tests/scans/scans_get.spec.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tests/scans/scans_get.spec.ts b/src/tests/scans/scans_get.spec.ts index da7d737..a4128b7 100644 --- a/src/tests/scans/scans_get.spec.ts +++ b/src/tests/scans/scans_get.spec.ts @@ -61,9 +61,17 @@ describe('adding + getting scans', () => { expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json") }); - it('check if scans was added (no parameter validation)', async () => { + it('check if scans was added directly', async () => { const res = await axios.get(base + '/api/scans/' + added_scan.id, axios_config); expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json"); + expect(res.data).toEqual(added_scan); + }); + it('check if scans was added via the runner/scans endpoint.', async () => { + const res = await axios.get(base + '/api/runners/' + added_runner.id + "/scans", axios_config); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json"); + added_scan.runner.distance = 0; + expect(res.data).toContainEqual(added_scan); }); }); \ No newline at end of file