index.spec.js 353 B

12345678910111213141516
  1. import PasswordInput from '..';
  2. import { mount } from '../../../test/utils';
  3. test('focus event', () => {
  4. const focus = jest.fn();
  5. const wrapper = mount(PasswordInput, {
  6. context: {
  7. on: {
  8. focus
  9. }
  10. }
  11. });
  12. wrapper.find('.van-password-input__security').trigger('touchstart');
  13. expect(focus).toHaveBeenCalledTimes(1);
  14. });