[improvement] Field: add focus method (#1987)

This commit is contained in:
neverland
2018-10-27 20:04:25 +08:00
committed by GitHub
parent a995c203dc
commit 7685ecd254
4 changed files with 16 additions and 0 deletions
+10
View File
@@ -110,6 +110,16 @@ test('blur method', () => {
expect(fn.mock.calls.length).toEqual(1);
});
test('focus method', () => {
const fn = jest.fn();
const wrapper = mount(Field);
wrapper.vm.$on('focus', fn);
wrapper.vm.focus();
expect(fn.mock.calls.length).toEqual(1);
});
test('maxlength', async() => {
const wrapper = mount(Field, {
attrs: {