feat(AddressList): add tag slots (#8292)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`should render tag slot correctly 1`] = `
|
||||
<div class="van-address-list">
|
||||
<div class="van-radio-group"
|
||||
role="radiogroup"
|
||||
>
|
||||
</div>
|
||||
<div class="van-address-list__bottom">
|
||||
<button type="button"
|
||||
class="van-button van-button--danger van-button--normal van-button--block van-button--round van-address-list__add"
|
||||
>
|
||||
<div class="van-button__content">
|
||||
<span class="van-button__text">
|
||||
Add new address
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -50,3 +50,12 @@ test('should emit click-item event when item is clicked', () => {
|
||||
|
||||
expect(wrapper.emitted('click-item')![0]).toEqual([list[0], 0]);
|
||||
});
|
||||
|
||||
test('should render tag slot correctly', () => {
|
||||
const wrapper = mount(AddressList, {
|
||||
slots: {
|
||||
tag: () => 'Custom Tag',
|
||||
},
|
||||
});
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user