test: Add test for healthcheck graphQL query

This commit is contained in:
Faruk AYDIN
2023-10-14 17:19:44 +02:00
parent 706142f98e
commit eaa25e412a

View 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);
});
});