vant/src/password-input/test/index.spec.js
2019-11-13 16:46:01 +08:00

17 lines
347 B
JavaScript

import PasswordInput from '..';
import { mount } from '../../../test';
test('focus event', () => {
const focus = jest.fn();
const wrapper = mount(PasswordInput, {
context: {
on: {
focus
}
}
});
wrapper.find('.van-password-input__security').trigger('touchstart');
expect(focus).toHaveBeenCalledTimes(1);
});