From 63901033d371a589ffafbf79b22274b93f81078c Mon Sep 17 00:00:00 2001 From: Zalmoxisus Date: Mon, 2 Jan 2017 18:49:28 +0200 Subject: [PATCH] [Test] GraphQL backend --- test/integration.spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/integration.spec.js b/test/integration.spec.js index 1079bf4..3703ede 100644 --- a/test/integration.spec.js +++ b/test/integration.spec.js @@ -164,4 +164,24 @@ describe('Server', function() { .expect(200, done); }); }); + + describe('GraphQL backend', function() { + it('should get the report', function(done) { + request('http://localhost:8000') + .post('/graphql') + .send({ + query: '{ reports { id, type, title } }' + }) + .set('Accept', 'application/json') + .expect('Content-Type', /application\/json/) + .expect(function(res) { + var reports = res.body.data.reports; + expect(reports.length).toBe(1); + expect(reports[0].id).toExist(); + expect(reports[0].title).toBe('Test report'); + expect(reports[0].type).toBe('ACTIONS'); + }) + .expect(200, done); + }); + }); });