fix(Stepper): should not display NaN

This commit is contained in:
chenjiahan
2020-05-09 10:10:35 +08:00
parent 09fdde8c56
commit 7327a481d1
2 changed files with 21 additions and 1 deletions
+19
View File
@@ -157,11 +157,30 @@ test('only allow interger', () => {
expect(wrapper.emitted('input')[1][0]).toEqual(1);
});
test('input invalid value and blur', () => {
const wrapper = mount(Stepper, {
propsData: {
value: '',
},
});
const input = wrapper.find('input');
input.element.value = '.';
input.trigger('input');
input.trigger('blur');
expect(wrapper.emitted('input').pop()).toEqual([1]);
});
test('stepper focus', () => {
const wrapper = mount(Stepper);
const input = wrapper.find('input');
input.trigger('focus');
expect(wrapper.emitted('focus')).toBeTruthy();
wrapper.setProps({ disableInput: true });
input.trigger('focus');
expect(wrapper.emitted('blur')).toBeTruthy();
});
test('stepper blur', () => {