From 7111068361e00cc1308664a3ae650a56e28c015c Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 6 Apr 2021 09:20:09 +0200 Subject: [PATCH] Added runners stats tests ref #190 --- src/tests/stats/stats_get.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/tests/stats/stats_get.spec.ts b/src/tests/stats/stats_get.spec.ts index 92b898a..488ad13 100644 --- a/src/tests/stats/stats_get.spec.ts +++ b/src/tests/stats/stats_get.spec.ts @@ -42,4 +42,22 @@ describe('GET /api/stats should return 200', () => { expect(res.status).toEqual(200); expect(res.headers['content-type']).toContain("application/json"); }); +}); +// --------------- +describe('GET /api/stats/runners/* should return 200', () => { + it('get by distance w/ auth should return 200', async () => { + const res = await axios.get(base + '/api/stats/runners/distance', axios_config_stats); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json"); + }); + it('get by donations w/ auth should return 200', async () => { + const res = await axios.get(base + '/api/stats/runners/donations', axios_config_stats); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json"); + }); + it('get by laptime w/ auth should return 200', async () => { + const res = await axios.get(base + '/api/stats/runners/laptime', axios_config_stats); + expect(res.status).toEqual(200); + expect(res.headers['content-type']).toContain("application/json"); + }); }); \ No newline at end of file