test: using isVisible

This commit is contained in:
chenjiahan 2021-01-02 21:06:27 +08:00
parent 866d9c0381
commit 1bfc4d32ed

View File

@ -299,8 +299,8 @@ test('should hide plus button when show-plus prop is false', () => {
showPlus: false, showPlus: false,
}, },
}); });
const plus = wrapper.find('.van-stepper__plus').element; const plus = wrapper.find('.van-stepper__plus');
expect(plus.style.display).toEqual('none'); expect(plus.isVisible()).toBeFalsy();
}); });
test('should hide minus button when show-minus prop is false', () => { test('should hide minus button when show-minus prop is false', () => {
@ -309,8 +309,8 @@ test('should hide minus button when show-minus prop is false', () => {
showMinus: false, showMinus: false,
}, },
}); });
const minus = wrapper.find('.van-stepper__minus').element; const minus = wrapper.find('.van-stepper__minus');
expect(minus.style.display).toEqual('none'); expect(minus.isVisible()).toBeFalsy();
}); });
test('should hide input when show-input prop is false', () => { test('should hide input when show-input prop is false', () => {
@ -319,7 +319,7 @@ test('should hide input when show-input prop is false', () => {
showInput: false, showInput: false,
}, },
}); });
expect(wrapper.find('input').element.style.display).toEqual('none'); expect(wrapper.find('input').isVisible()).toBeFalsy();
}); });
test('should limit dicimal length when using decimal-length prop', async () => { test('should limit dicimal length when using decimal-length prop', async () => {