salix/back/methods/account/specs/set-password.spec.js

16 lines
514 B
JavaScript
Raw Normal View History

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();
});
});