feat(Stepper): add long-press prop

This commit is contained in:
陈嘉涵
2020-01-15 19:49:10 +08:00
parent b8a6b67975
commit 2f3ec6a3d4
5 changed files with 43 additions and 2 deletions
+25
View File
@@ -89,6 +89,22 @@ test('long press', async () => {
expect(wrapper.emitted('input')).toEqual([[2], [3], [4]]);
});
test('disable long press', async () => {
const wrapper = mount(Stepper, {
propsData: {
value: 1,
longPress: false
}
});
const plus = wrapper.find('.van-stepper__plus');
plus.trigger('touchstart');
await later(800);
plus.trigger('touchend');
expect(wrapper.emitted('input')).toBeFalsy();
});
test('filter value during user input', () => {
const wrapper = mount(Stepper, {
propsData: {
@@ -178,6 +194,15 @@ test('input-width prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('button-size prop', () => {
const wrapper = mount(Stepper, {
propsData: {
buttonSize: '2rem'
}
});
expect(wrapper).toMatchSnapshot();
});
test('async-change prop', () => {
const wrapper = mount(Stepper, {
propsData: {