feat(ShareSheet): add cancel slot (#8335)
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`should render cancel slot correctly 1`] = `
|
||||
<button type="button"
|
||||
class="van-share-sheet__cancel"
|
||||
>
|
||||
Custom Cancel
|
||||
</button>
|
||||
`;
|
||||
|
||||
exports[`should render cancel text when using cancel-text prop 1`] = `
|
||||
<button type="button"
|
||||
class="van-share-sheet__cancel"
|
||||
|
||||
@@ -104,3 +104,16 @@ test('should emit click-overlay event when overlay is clicked', async () => {
|
||||
expect(onClickOverlay).toHaveBeenCalledTimes(1);
|
||||
expect(wrapper.emitted('update:show')![0]).toEqual([false]);
|
||||
});
|
||||
|
||||
test('should render cancel slot correctly', async () => {
|
||||
const wrapper = mount(ShareSheet, {
|
||||
props: {
|
||||
show: true,
|
||||
},
|
||||
slots: {
|
||||
cancel: () => 'Custom Cancel',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.find('.van-share-sheet__cancel').html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user