feat(ShareSheet): add cancel slot (#8335)

This commit is contained in:
neverland
2021-03-14 11:24:48 +08:00
committed by GitHub
parent c424d6efcd
commit 2961384530
5 changed files with 36 additions and 13 deletions
+13
View File
@@ -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();
});