[Improvement] Field: add blur method (#1264)

This commit is contained in:
neverland
2018-06-11 20:08:14 +08:00
committed by GitHub
parent c86405dd9f
commit 409055195b
6 changed files with 46 additions and 13 deletions
@@ -99,3 +99,16 @@ test('autosize object', async() => {
await later();
expect(textarea.element.style.height).toEqual(('50px'));
});
test('blur method', () => {
const fn = jest.fn();
const wrapper = mount(Field, {
listeners: {
blur: fn
}
});
wrapper.find('input').element.focus();
wrapper.vm.blur();
expect(fn.mock.calls.length).toEqual(1);
});