feat(Popover): add close-on-click-overlay prop (#8351)
This commit is contained in:
@@ -161,3 +161,17 @@ test('should emit click-overlay event when overlay is clicked', () => {
|
||||
wrapper.find('.van-overlay').trigger('click');
|
||||
expect(onClickOverlay).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
test('should not close Popover when overlay is clicked and close-on-click-overlay is false', () => {
|
||||
const wrapper = mount(Popover, {
|
||||
props: {
|
||||
show: true,
|
||||
overlay: true,
|
||||
closeOnClickOverlay: false,
|
||||
},
|
||||
});
|
||||
|
||||
const overlay = document.querySelector('.van-overlay')!;
|
||||
trigger(overlay, 'touchstart');
|
||||
expect(wrapper.emitted('update:show')).toBeFalsy();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user