Skip to content

Commit

Permalink
Corrección test gateway-service
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287998 committed Apr 3, 2024
1 parent f312468 commit 3995993
Show file tree
Hide file tree
Showing 2 changed files with 4,914 additions and 4,910 deletions.
20 changes: 12 additions & 8 deletions gatewayservice/gateway-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ describe('Gateway Service', () => {
expect(response.statusCode).toBe(200);
expect(response.body.userId).toBe('mockedUserId');
});
// Test /generate-question endpoint
it('should forward generate question request to question service', async () => {
const response = await request(app)
.get('/generate-question');
// Test /generate-question endpoint
it('should forward generate question request to question service', async () => {
const response = await request(app)
.get('/generate-question')
.set('Authorization', 'Bearer some-token');

expect(response.statusCode).toBe(200);
expect(response.body.question).toBe('mockedQuestion');

});
if (response.statusCode !== 200) {
console.error(response.body.error);
}

expect(response.statusCode).toBe(200);
expect(response.body.question).toBe('mockedQuestion');
});
// Test /questions endpoint
it('should forward get questions request to question service', async () => {
const response = await request(app)
Expand Down
Loading

0 comments on commit 3995993

Please sign in to comment.