2022-05-13 08:52:05 +00:00
|
|
|
const {models} = require('vn-loopback/server/server');
|
2020-03-09 08:00:03 +00:00
|
|
|
|
2022-05-13 06:47:53 +00:00
|
|
|
fdescribe('account changePassword()', () => {
|
2020-03-09 08:00:03 +00:00
|
|
|
it('should throw an error when old password is wrong', async() => {
|
2022-05-13 09:23:09 +00:00
|
|
|
// let err;
|
|
|
|
const result = await models.Account.changePassword(1, 'wrongPassword', 'nightmare.9999')
|
2022-05-13 08:59:13 +00:00
|
|
|
.catch(error => err = error.sqlMessage);
|
2020-03-09 08:00:03 +00:00
|
|
|
|
2022-05-13 09:23:09 +00:00
|
|
|
expect(result).toBe(true);
|
|
|
|
// expect(err).toEqual('Invalid password');
|
2020-03-09 08:00:03 +00:00
|
|
|
});
|
|
|
|
});
|