[Improvement] Stepper blur (#1316)

This commit is contained in:
neverland
2018-06-22 15:46:51 +08:00
committed by GitHub
parent 6204892ad7
commit 1da6a30f19
4 changed files with 34 additions and 1 deletions

View File

@@ -92,3 +92,25 @@ test('only allow interger', () => {
expect(fn.mock.calls.length).toEqual(1);
});
test('stepper blur', () => {
const wrapper = mount(Stepper, {
propsData: {
value: 5,
min: 3
}
});
wrapper.vm.$on('input', value => {
wrapper.setProps({ value });
});
const input = wrapper.find('input');
input.trigger('blur');
input.element.value = '';
input.trigger('input');
input.trigger('blur');
expect(wrapper.emitted('input')).toEqual([[''], [3]]);
expect(wrapper.emitted('blur')).toBeTruthy();
});