types: test cases typing
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import PasswordInput from '..';
|
||||
import { mount } from '../../../test';
|
||||
|
||||
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();
|
||||
});
|
||||
Reference in New Issue
Block a user