feat(Stepper): should limit decimal length when input (#4747)

This commit is contained in:
neverland
2019-10-16 16:37:28 +08:00
committed by GitHub
parent a65bd84e0a
commit acc972a203
2 changed files with 23 additions and 1 deletions
+16
View File
@@ -213,3 +213,19 @@ test('decimal-length prop', () => {
plus.trigger('click');
expect(wrapper.emitted('input')[1][0]).toEqual('1.20');
});
test('should limit decimal-length when input', () => {
const wrapper = mount(Stepper, {
propsData: {
value: 1,
step: 0.2,
decimalLength: 1
}
});
const input = wrapper.find('input');
input.element.value = '1.25';
input.trigger('input');
expect(input.element.value).toEqual('1.2');
});