2020-03-09 08:00:03 +00:00
|
|
|
const app = require('vn-loopback/server/server');
|
|
|
|
|
2022-09-22 07:22:24 +00:00
|
|
|
describe('account setPassword()', () => {
|
2020-03-09 08:00:03 +00:00
|
|
|
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.');
|
|
|
|
|
|
|
|
await expectAsync(req).toBeResolved();
|
|
|
|
});
|
|
|
|
});
|