From ab2583b400f4bb468d90288a2b352f4b6ae9edb6 Mon Sep 17 00:00:00 2001 From: HA Date: Sat, 19 May 2018 09:56:11 +0100 Subject: [PATCH] add failing post report query test :white_check_mark: Relates #33 #34 #35 --- src/test/model/post_report.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/model/post_report.test.js diff --git a/src/test/model/post_report.test.js b/src/test/model/post_report.test.js new file mode 100644 index 0000000..a2b8e33 --- /dev/null +++ b/src/test/model/post_report.test.js @@ -0,0 +1,22 @@ +const test = require('tape'); //eslint-disable-line +const request = require('supertest'); //eslint-disable-line +// require test database build script +const runDbBuild = require('../../model/database/db_build'); +// require query functions +const { postReport } = require('../../model/queries/'); + +test('Test postChallenge query', (t) => { + runDbBuild() + .then((res) => { + t.ok(res); + return postReport(3, 3, 'This is a new test report'); + }) + .then((id) => { + t.ok(id, 'postReport returns new report id'); + t.end(); + }) + .catch((e) => { + t.error(e); + t.end(); + }); +});