chore: add trailingComma

This commit is contained in:
陈嘉涵
2020-01-19 11:57:09 +08:00
parent e841175fe8
commit 389d68884d
269 changed files with 2706 additions and 2702 deletions
+22 -22
View File
@@ -13,17 +13,17 @@ const coupon = {
name: 'name',
description: 'description',
startAt: 1489104000,
endAt: 1514592000
endAt: 1514592000,
};
const coupon2 = {
...coupon,
denominations: 100
denominations: 100,
};
const coupon3 = {
...coupon,
denominations: 123
denominations: 123,
};
const emptyCoupon = {
@@ -32,7 +32,7 @@ const emptyCoupon = {
denominations: 0,
originCondition: 0,
startAt: 1489104000,
endAt: 1514592000
endAt: 1514592000,
};
const discountCoupon = {
@@ -42,7 +42,7 @@ const discountCoupon = {
denominations: 0,
originCondition: 50,
value: 12,
description: ''
description: '',
};
const discountCoupon2 = {
@@ -52,28 +52,28 @@ const discountCoupon2 = {
denominations: 0,
originCondition: 50,
value: 12,
description: ''
description: '',
};
const disabledCoupon = {
...coupon,
id: 3,
reason: 'reason'
reason: 'reason',
};
const disabledDiscountCoupon = {
...discountCoupon,
discount: 10,
id: 4,
reason: ''
reason: '',
};
test('render disabled coupon', () => {
const wrapper = mount(Coupon, {
propsData: {
coupon: disabledCoupon,
disabled: true
}
disabled: true,
},
});
expect(wrapper).toMatchSnapshot();
@@ -84,8 +84,8 @@ test('render coupon list', async () => {
propsData: {
chosenCoupon: 1,
coupons: [emptyCoupon, coupon, coupon2, coupon3, discountCoupon, discountCoupon2],
disabledCoupons: [disabledCoupon, disabledDiscountCoupon]
}
disabledCoupons: [disabledCoupon, disabledDiscountCoupon],
},
});
await later();
expect(wrapper).toMatchSnapshot();
@@ -95,8 +95,8 @@ test('render empty coupon list', () => {
const wrapper = mount(CouponList, {
propsData: {
coupons: [],
disabledCoupons: []
}
disabledCoupons: [],
},
});
wrapper.findAll('.van-tab').at(1).trigger('click');
expect(wrapper).toMatchSnapshot();
@@ -105,8 +105,8 @@ test('render empty coupon list', () => {
test('empty-image prop', () => {
const wrapper = mount(CouponList, {
propsData: {
emptyImage: 'https://img.yzcdn.com/xxx.png'
}
emptyImage: 'https://img.yzcdn.com/xxx.png',
},
});
expect(wrapper).toMatchSnapshot();
@@ -118,7 +118,7 @@ test('exchange coupon', () => {
wrapper.setData({
currentCode: '1',
displayedCouponIndex: 1
displayedCouponIndex: 1,
});
exchange.trigger('click');
wrapper.setProps({ code: '2' });
@@ -136,9 +136,9 @@ test('render coupon cell', () => {
const wrapper = mount(CouponCell, {
context: {
on: {
click: onClick
}
}
click: onClick,
},
},
});
expect(wrapper).toMatchSnapshot();
@@ -150,8 +150,8 @@ test('render coupon cell with coupon', () => {
const wrapper = mount(CouponCell, {
propsData: {
coupons: [{ value: 100 }],
chosenCoupon: 0
}
chosenCoupon: 0,
},
});
expect(wrapper).toMatchSnapshot();
});