feat: one more test

v1.18.x
Barış Soner Uşaklı 5 years ago
parent ecda4ad8ad
commit a333cb6ca4

@ -850,6 +850,16 @@ describe('User', function () {
assert.equal(err.message, '[[user:change_password_error_privileges]]');
});
it('should let admin change another users password', async function () {
const adminUid = await User.create({ username: 'adminpwdchange2', password: 'admin1234' });
await groups.join('administrators', adminUid);
const uid = await User.create({ username: 'forgotmypassword', password: '123456' });
await socketUser.changePassword({ uid: adminUid }, { uid: uid, newPassword: '654321' });
const correct = await User.isPasswordCorrect(uid, '654321', '127.0.0.1');
assert(correct);
});
it('should change username', function (done) {
socketUser.changeUsernameEmail({ uid: uid }, { uid: uid, username: 'updatedAgain', password: '123456' }, function (err) {
assert.ifError(err);

Loading…
Cancel
Save