[bugfix] CouponList: incorrectly render when disabled list empty (#2845)

This commit is contained in:
neverland
2019-02-26 11:57:23 +08:00
committed by GitHub
parent 8f3dc3f9ca
commit 2dcd64c515
3 changed files with 50 additions and 1 deletions
+12
View File
@@ -75,6 +75,7 @@ test('render disabled coupon', () => {
disabled: true
}
});
expect(wrapper).toMatchSnapshot();
});
@@ -90,6 +91,17 @@ test('render coupon list', async () => {
expect(wrapper).toMatchSnapshot();
});
test('render empty coupon list', () => {
const wrapper = mount(CouponList, {
propsData: {
coupons: [],
disabledCoupons: []
}
});
wrapper.findAll('.van-tab').at(1).trigger('click');
expect(wrapper).toMatchSnapshot();
});
test('exchange coupon', () => {
const wrapper = mount(CouponList);
const exchange = wrapper.find('.van-coupon-list__exchange');