fix(GoodsActionIcon): info not work with icon slot (#5788)

This commit is contained in:
chenjiahan
2020-03-10 20:33:11 +08:00
parent 885a9e6ac7
commit f2e9e1931b
4 changed files with 36 additions and 2 deletions
@@ -12,6 +12,15 @@ exports[`Icon render default slot 1`] = `
exports[`Icon render icon slot 1`] = `
<div role="button" tabindex="0" class="van-goods-action-icon">
<div class="van-goods-action-icon__icon">Custom Icon</div>Text
<div class="van-goods-action-icon__icon">Custom Icon
<!---->
</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>
</div>Text
</div>
`;
+18
View File
@@ -48,3 +48,21 @@ test('Icon render icon slot', () => {
expect(wrapper).toMatchSnapshot();
});
test('Icon render icon slot with info', () => {
const wrapper = mount({
render(h) {
return h(Icon, {
props: {
info: '1',
},
scopedSlots: {
default: () => 'Text',
icon: () => 'Custom Icon',
},
});
},
});
expect(wrapper).toMatchSnapshot();
});