Fixed bug when trying to auth with empty username and empty password
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -140,6 +140,21 @@ test('test-cases/01basic.js: Auth by wrong username', async t => {
|
||||
}
|
||||
});
|
||||
|
||||
test('test-cases/01basic.js: Auth by empty username and empty password', async t => {
|
||||
try {
|
||||
await got.post(`${process.env.AUTH_URL}/auth/password`, {
|
||||
json: {
|
||||
name: '',
|
||||
password: '',
|
||||
},
|
||||
responseType: 'json',
|
||||
});
|
||||
t.fail('Trying to login with wrong username should fail with a 403');
|
||||
} catch(err) {
|
||||
t.equal(err.message, 'Response code 403 (Forbidden)', 'Trying to login with wrong username should fail with a 403');
|
||||
}
|
||||
});
|
||||
|
||||
test('test-cases/01basic.js: PUT /account/{id}/fields', async t => {
|
||||
const res = await got.put(`${process.env.AUTH_URL}/account/${user.id}/fields`, {
|
||||
headers: { 'Authorization': `bearer ${adminJWTString}`},
|
||||
|
||||
Reference in New Issue
Block a user