feat(Stepper): add name prop (#4931)

This commit is contained in:
neverland
2019-11-05 17:54:59 +08:00
committed by GitHub
parent 0d3eec10b5
commit ad36ddc60f
4 changed files with 28 additions and 9 deletions

View File

@@ -229,3 +229,16 @@ test('should limit decimal-length when input', () => {
expect(input.element.value).toEqual('1.2');
});
test('name prop', () => {
const wrapper = mount(Stepper);
const plus = wrapper.find('.van-stepper__plus');
plus.trigger('click');
expect(wrapper.emitted('change')[0][1]).toEqual({ name: '' });
wrapper.setProps({ name: 'name' });
plus.trigger('click');
expect(wrapper.emitted('change')[1][1]).toEqual({ name: 'name' });
});