[improvement] PasswordInput: functional (#2694)

This commit is contained in:
neverland
2019-02-06 20:58:55 +08:00
committed by GitHub
parent 305dc19ceb
commit 061382014d
2 changed files with 60 additions and 44 deletions

View 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);
});