0
0
Fork 0

chore: refs #7702 fix tests

This commit is contained in:
Jorge Penadés 2024-10-04 11:54:40 +02:00
parent 67c2e284ba
commit ae8e4ba4b9
1 changed files with 16 additions and 5 deletions

View File

@ -50,10 +50,21 @@ describe('VnSmsDialog', () => {
);
});
it('should call submitFn and emit onSubmit when passwords match', async () => {
vm.passwords.newPassword = 'password';
vm.passwords.repeatPassword = 'password';
await vm.validate();
expect(vm.props.submitFn).toHaveBeenCalledWith('password');
describe('if passwords match', () => {
it('should call submitFn and emit password', async () => {
vm.passwords.newPassword = 'password';
vm.passwords.repeatPassword = 'password';
await vm.validate();
expect(vm.props.submitFn).toHaveBeenCalledWith('password', undefined);
});
it('should call submitFn and emit password and old password', async () => {
vm.passwords.newPassword = 'password';
vm.passwords.repeatPassword = 'password';
vm.passwords.oldPassword = 'oldPassword';
await vm.validate();
expect(vm.props.submitFn).toHaveBeenCalledWith('password', 'oldPassword');
});
});
});