Skip to content

Commit

Permalink
/health test added and others commented
Browse files Browse the repository at this point in the history
  • Loading branch information
UO287687 committed Feb 23, 2024
1 parent 20e9124 commit de57f9e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions gatewayservice/gateway-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ describe('Gateway Service', () => {
return Promise.resolve({ data: { userId: 'mockedUserId' } });
}
});
// Test /health endpoint
it('should give information of the status', async () => {
const response = await request(app)
.get('/health');

expect(response.statusCode).toBe(200);
expect(response.body.status).toBe('OK');
});

// Test /login endpoint
it('should forward login request to auth service', async () => {
Expand All @@ -37,7 +45,7 @@ describe('Gateway Service', () => {
expect(response.statusCode).toBe(200);
expect(response.body.userId).toBe('mockedUserId');
});

/*
// Test /api/questions/create endpoint
it('should forward create question request to question generation service', async () => {
const response = await request(app)
Expand All @@ -47,7 +55,7 @@ describe('Gateway Service', () => {
expect(response.body).toHaveProperty('question');
expect(response.body).toHaveProperty('correct');
expect(response.body).toHaveProperty('incorrects');
},1000000);
},100000);
// Test /addquestion endpoint
it('should add a new question', async () => {
Expand All @@ -61,5 +69,5 @@ describe('Gateway Service', () => {
expect(response.statusCode).toBe(200);
expect(response.body).toHaveProperty('question', 'What is the capital of France?');
});
}); */
});

0 comments on commit de57f9e

Please sign in to comment.