fix(GoodsActionIcon): info not work with icon slot (#5788)
This commit is contained in:
@@ -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>
|
||||
`;
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user