mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[Improvement] Stepper blur (#1316)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user