mirror of
https://github.com/youzan/vant.git
synced 2026-05-10 01:06:44 +08:00
fix(Field): incorrect maxlength slicing (#7284)
* fix(Field): incorrect maxlength slicing * chore: robust
This commit is contained in:
@@ -171,17 +171,25 @@ test('maxlength', async () => {
|
||||
value: 1234,
|
||||
type: 'number',
|
||||
},
|
||||
listeners: {
|
||||
input(value) {
|
||||
wrapper && wrapper.setProps({ value });
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const input = wrapper.find('input');
|
||||
expect(input.element.value).toEqual('123');
|
||||
|
||||
input.element.value = 1234;
|
||||
await later();
|
||||
input.trigger('input');
|
||||
|
||||
expect(input.element.value).toEqual('123');
|
||||
expect(wrapper.emitted('input')[0][0]).toEqual('123');
|
||||
|
||||
// see: https://github.com/youzan/vant/issues/7265
|
||||
input.element.value = 1423;
|
||||
input.trigger('input');
|
||||
expect(input.element.value).toEqual('123');
|
||||
});
|
||||
|
||||
test('clearable prop', () => {
|
||||
|
||||
Reference in New Issue
Block a user