[Improvement] Slider: add test cases (#1192)

This commit is contained in:
neverland
2018-05-30 14:57:14 +08:00
committed by GitHub
parent 4614260e1c
commit 92c108e245
10 changed files with 104 additions and 28 deletions
+5 -3
View File
@@ -6,10 +6,12 @@ test('exchange coupon', () => {
const wrapper = mount(CouponList);
const exchange = wrapper.find('.van-coupon-list__exchange');
wrapper.vm.displayedCouponIndex = 1;
wrapper.vm.currentCode = '1';
wrapper.setData({
currentCode: '1',
displayedCouponIndex: 1
});
exchange.trigger('click');
wrapper.vm.code = '2';
wrapper.setProps({ code: '2' });
exchange.trigger('click');
expect(wrapper.emitted('exchange')[0][0]).toBe('1');