feat(Calendar): add click-subtitle event (#8981)

This commit is contained in:
neverland
2021-07-05 13:25:58 +08:00
committed by GitHub
parent 779f3363c2
commit b5ea1cd3ad
5 changed files with 34 additions and 3 deletions
+15
View File
@@ -554,3 +554,18 @@ test('should render top-info and bottom-info slot correctly', async () => {
expect(wrapper.find('.van-calendar__day').html()).toMatchSnapshot();
});
test('should emit click-subtitle event when clicking the subtitle', async () => {
const wrapper = mount(Calendar, {
props: {
minDate,
maxDate,
poppable: false,
lazyRender: false,
},
});
await later();
wrapper.find('.van-calendar__header-subtitle').trigger('click');
expect(wrapper.emitted('click-subtitle')).toBeTruthy();
});