diff --git a/packages/coupon-list/index.js b/packages/coupon-list/index.js
index 598f96fa8..ed9ae2888 100644
--- a/packages/coupon-list/index.js
+++ b/packages/coupon-list/index.js
@@ -190,7 +190,7 @@ export default sfc({
{this.disabledCoupons.map(coupon => (
))}
- {!this.disabledCoupons.length && this.renderEmpty}
+ {!this.disabledCoupons.length && this.renderEmpty()}
);
diff --git a/packages/coupon-list/test/__snapshots__/index.spec.js.snap b/packages/coupon-list/test/__snapshots__/index.spec.js.snap
index 7ae019022..51a923eeb 100644
--- a/packages/coupon-list/test/__snapshots__/index.spec.js.snap
+++ b/packages/coupon-list/test/__snapshots__/index.spec.js.snap
@@ -140,3 +140,40 @@ exports[`render disabled coupon 1`] = `
reason
`;
+
+exports[`render empty coupon list 1`] = `
+
+
+
+
+
+
+
可使用优惠券 (0)
+
不可使用优惠券 (0)
+
+
+
+
+
+

+
暂无优惠券
+
+
+
+
+
+

+
暂无优惠券
+
+
+
+
+
+
+`;
diff --git a/packages/coupon-list/test/index.spec.js b/packages/coupon-list/test/index.spec.js
index a0eca2f06..b61c53f91 100644
--- a/packages/coupon-list/test/index.spec.js
+++ b/packages/coupon-list/test/index.spec.js
@@ -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');