2020-03-09 08:00:03 +00:00
|
|
|
const app = require('vn-loopback/server/server');
|
|
|
|
|
|
|
|
describe('account changePassword()', () => {
|
|
|
|
it('should throw an error when password does not meet requirements', async() => {
|
|
|
|
let req = app.models.Account.setPassword(1, 'insecurePass');
|
|
|
|
|
|
|
|
await expectAsync(req).toBeRejected();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should update password when it passes requirements', async() => {
|
|
|
|
let req = app.models.Account.setPassword(1, 'Very$ecurePa22.');
|
|
|
|
|
2022-05-13 10:58:06 +00:00
|
|
|
await expectAsync(req).toBeResolved();
|
2020-03-09 08:00:03 +00:00
|
|
|
});
|
|
|
|
});
|