[Test] GraphQL backend
This commit is contained in:
parent
12b0ac9c74
commit
63901033d3
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user