mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
[improvement] PasswordInput: functional (#2694)
This commit is contained in:
16
packages/password-input/test/index.spec.js
Normal file
16
packages/password-input/test/index.spec.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import PasswordInput from '..';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('focus event', () => {
|
||||
const focus = jest.fn();
|
||||
const wrapper = mount(PasswordInput, {
|
||||
context: {
|
||||
on: {
|
||||
focus
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
wrapper.find('.van-password-input__security').trigger('touchstart');
|
||||
expect(focus.mock.calls.length).toEqual(1);
|
||||
});
|
Reference in New Issue
Block a user