feat(DatetimePicker): support picker slots (#7645)

This commit is contained in:
neverland
2020-11-26 19:57:28 +08:00
committed by GitHub
parent 488d90aab9
commit d3f38c29f9
6 changed files with 41 additions and 0 deletions
@@ -35,3 +35,16 @@ test('getPicker method', () => {
const wrapper = mount(DatetimePicker);
expect(wrapper.vm.getPicker()).toBeTruthy();
});
test('should render title slot correctly', () => {
const wrapper = mount(DatetimePicker, {
propsData: {
showToolbar: true,
},
scopedSlots: {
title: () => 'Custom title',
},
});
expect(wrapper.find('.van-picker__toolbar')).toMatchSnapshot();
});