[new feature] GoodsActionIcon: add icon slot (#3705)
This commit is contained in:
@@ -9,3 +9,9 @@ exports[`Icon render default slot 1`] = `
|
||||
</div>Default Content
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Icon render icon slot 1`] = `
|
||||
<div role="button" tabindex="0" class="van-goods-action-icon van-hairline">
|
||||
<div class="van-goods-action-icon__icon">Custom Icon</div>Text
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -49,3 +49,18 @@ test('Icon render default slot', () => {
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('Icon render icon slot', () => {
|
||||
const wrapper = mount({
|
||||
render(h) {
|
||||
return h(Icon, {
|
||||
scopedSlots: {
|
||||
default: () => 'Text',
|
||||
icon: () => 'Custom Icon'
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user