test: Add test for healthcheck graphQL query
This commit is contained in:
26
packages/backend/src/graphql/queries/healthcheck.test.ts
Normal file
26
packages/backend/src/graphql/queries/healthcheck.test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from 'supertest';
|
||||
import app from '../../app';
|
||||
import appConfig from '../../config/app';
|
||||
|
||||
describe('graphQL healthcheck query', () => {
|
||||
it('should return application version', async () => {
|
||||
const query = `
|
||||
query {
|
||||
healthcheck {
|
||||
version
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const response = await request(app)
|
||||
.post('/graphql')
|
||||
.send({ query })
|
||||
.expect(200);
|
||||
|
||||
const expectedResponsePayload = {
|
||||
data: { healthcheck: { version: appConfig.version } },
|
||||
};
|
||||
|
||||
expect(response.body).toEqual(expectedResponsePayload);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user