chore: add trailingComma
This commit is contained in:
@@ -75,19 +75,19 @@ export default {
|
||||
'zh-CN': {
|
||||
title: '商品名称',
|
||||
discountInfo: '营销信息',
|
||||
customContent: '自定义内容'
|
||||
customContent: '自定义内容',
|
||||
},
|
||||
'en-US': {
|
||||
discountInfo: 'Discount Info',
|
||||
customContent: 'Custom Content'
|
||||
}
|
||||
customContent: 'Custom Content',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
imageURL: 'https://img.yzcdn.cn/vant/t-thirt.jpg'
|
||||
imageURL: 'https://img.yzcdn.cn/vant/t-thirt.jpg',
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+2
-2
@@ -206,8 +206,8 @@ Card.props = {
|
||||
originPrice: [Number, String],
|
||||
currency: {
|
||||
type: String,
|
||||
default: '¥'
|
||||
}
|
||||
default: '¥',
|
||||
},
|
||||
};
|
||||
|
||||
export default createComponent<CardProps, CardEvents>(Card);
|
||||
|
||||
+21
-21
@@ -6,16 +6,16 @@ test('click event', () => {
|
||||
const wrapper = mount(Card, {
|
||||
context: {
|
||||
on: {
|
||||
click: onClick
|
||||
}
|
||||
}
|
||||
click: onClick,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
|
||||
expect(onClick).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
isTrusted: expect.any(Boolean)
|
||||
isTrusted: expect.any(Boolean),
|
||||
})
|
||||
);
|
||||
});
|
||||
@@ -24,20 +24,20 @@ test('click-thumb event', () => {
|
||||
const onClickThumb = jest.fn();
|
||||
const wrapper = mount(Card, {
|
||||
propsData: {
|
||||
thumb: 'xx'
|
||||
thumb: 'xx',
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
'click-thumb': onClickThumb
|
||||
}
|
||||
}
|
||||
'click-thumb': onClickThumb,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.find('.van-card__thumb').trigger('click');
|
||||
|
||||
expect(onClickThumb).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
isTrusted: expect.any(Boolean)
|
||||
isTrusted: expect.any(Boolean),
|
||||
})
|
||||
);
|
||||
});
|
||||
@@ -46,8 +46,8 @@ test('render price & num slot', () => {
|
||||
const wrapper = mount(Card, {
|
||||
scopedSlots: {
|
||||
num: () => 'Custom Num',
|
||||
price: () => 'Custom Price'
|
||||
}
|
||||
price: () => 'Custom Price',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -56,8 +56,8 @@ test('render price & num slot', () => {
|
||||
test('render origin-price slot', () => {
|
||||
const wrapper = mount(Card, {
|
||||
scopedSlots: {
|
||||
'origin-price': () => 'Custom Origin Price'
|
||||
}
|
||||
'origin-price': () => 'Custom Origin Price',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -66,8 +66,8 @@ test('render origin-price slot', () => {
|
||||
test('render bottom slot', () => {
|
||||
const wrapper = mount(Card, {
|
||||
scopedSlots: {
|
||||
bottom: () => 'Custom Bottom'
|
||||
}
|
||||
bottom: () => 'Custom Bottom',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -77,8 +77,8 @@ test('render thumb & tag slot', () => {
|
||||
const wrapper = mount(Card, {
|
||||
scopedSlots: {
|
||||
tag: () => 'Custom Tag',
|
||||
thumb: () => 'Custom Thumb'
|
||||
}
|
||||
thumb: () => 'Custom Thumb',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -88,8 +88,8 @@ test('render title & desc slot', () => {
|
||||
const wrapper = mount(Card, {
|
||||
scopedSlots: {
|
||||
title: () => 'Custom Title',
|
||||
desc: () => 'Custom desc'
|
||||
}
|
||||
desc: () => 'Custom desc',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -99,8 +99,8 @@ test('render price & price-top slot', () => {
|
||||
const wrapper = mount(Card, {
|
||||
scopedSlots: {
|
||||
price: () => 'Custom Price',
|
||||
'price-top': () => 'Custom Price-top'
|
||||
}
|
||||
'price-top': () => 'Custom Price-top',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
Reference in New Issue
Block a user