Skip to content

Commit

Permalink
question-service test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
angelalvaigle committed Dec 1, 2024
1 parent fb80776 commit 9030d4f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions questionservice/question-service.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import request from 'supertest';
import { MongoMemoryServer } from 'mongodb-memory-server';
import Question from './question-model.js';

let mongoServer;
let app;
Expand Down Expand Up @@ -28,6 +29,12 @@ describe('Question Service', () => {
wrong3: 'testWrong3',
};

// El usuario se loguea
await request(app).post('/login').send({
username: 'testuser',
password: 'testpassword',
});

const response = await request(app).post('/addquestion').send(newQuestion);
expect(response.status).toBe(200);
expect(response.body).toHaveProperty('type', 'testType');
Expand Down

0 comments on commit 9030d4f

Please sign in to comment.