feat(CouponList): add list-footer、disabled-list-footer slot (#8801)

This commit is contained in:
neverland
2021-06-03 14:08:05 +08:00
committed by GitHub
parent 21e763b42a
commit dc2e40c4cc
5 changed files with 144 additions and 11 deletions
+15
View File
@@ -144,3 +144,18 @@ test('should emit "update:code" event when input a code', async () => {
await wrapper.setProps({ code: '2' });
expect(wrapper.emitted('update:code')![2]).toEqual(['2']);
});
test('should render list-footer slot correctly', async () => {
const wrapper = mount(CouponList, {
slots: {
'list-footer': () => 'List Footer',
'disabled-list-footer': () => 'Disabled List Footer',
},
});
await later();
const tabs = wrapper.findAll('.van-tab');
await tabs[1].trigger('click');
expect(wrapper.html()).toMatchSnapshot();
});