feat(GoodsActionIcon): add dot prop

This commit is contained in:
chenjiahan
2020-03-10 20:38:11 +08:00
parent f2e9e1931b
commit b983ac0891
7 changed files with 35 additions and 6 deletions
@@ -20,7 +20,7 @@ exports[`renders demo correctly 1`] = `
<div class="van-goods-action">
<div role="button" tabindex="0" class="van-goods-action-icon">
<div class="van-icon van-icon-chat-o van-goods-action-icon__icon">
<!---->
<div class="van-info van-info--dot"></div>
</div>客服
</div>
<div role="button" tabindex="0" class="van-goods-action-icon">
@@ -18,6 +18,13 @@ exports[`Icon render icon slot 1`] = `
</div>
`;
exports[`Icon render icon slot with dot 1`] = `
<div role="button" tabindex="0" class="van-goods-action-icon">
<div class="van-goods-action-icon__icon">Custom Icon<div class="van-info van-info--dot"></div>
</div>Text
</div>
`;
exports[`Icon render icon slot with info 1`] = `
<div role="button" tabindex="0" class="van-goods-action-icon">
<div class="van-goods-action-icon__icon">Custom Icon<div class="van-info">1</div>
+18
View File
@@ -66,3 +66,21 @@ test('Icon render icon slot with info', () => {
expect(wrapper).toMatchSnapshot();
});
test('Icon render icon slot with dot', () => {
const wrapper = mount({
render(h) {
return h(Icon, {
props: {
dot: true,
},
scopedSlots: {
default: () => 'Text',
icon: () => 'Custom Icon',
},
});
},
});
expect(wrapper).toMatchSnapshot();
});