vant/src/password-input/test/index.spec.ts
neverland 1381070a12
chore: prefer named exports (#8315)
* chore: prefer named exports

* chore: fix import
2021-03-09 15:39:26 +08:00

20 lines
553 B
TypeScript

import { mount } from '../../../test';
import { PasswordInput } from '..';
test('should emit focus event when security is touched', () => {
const wrapper = mount(PasswordInput);
wrapper.find('.van-password-input__security').trigger('touchstart');
expect(wrapper.emitted('focus')!.length).toEqual(1);
});
test('should render error info correctly', () => {
const wrapper = mount(PasswordInput, {
props: {
errorInfo: 'error!',
},
});
expect(
wrapper.find('.van-password-input__error-info').html()
).toMatchSnapshot();
});