Skip to content

Commit

Permalink
prueba
Browse files Browse the repository at this point in the history
  • Loading branch information
UO276026 committed Apr 25, 2024
1 parent c334caa commit 16f3715
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions gatewayservice/gateway-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ describe('Gateway Service', () => {

// Prueba de manejo de errores para el endpoint /adduser
it('deberia devolver error al registrate', async () => {
// Datos de prueba para registro (incorrectos)
const invalidLoginData = {
username: 'userInvalido',
password: process.env.INVALID_PASSWORD
};

// Realizamos una solicitud POST al endpoint /login con datos incorrectos
const response = await request(app)
.post('/adduser')
.send(invalidLoginData);
.send({ username: 'userInvalido', password: 'invalid' });


// Verificamos que la respuesta tenga un código de estado 401 (Unauthorized)
expect(response.statusCode).toBe(401);
Expand Down

0 comments on commit 16f3715

Please sign in to comment.