test(Popover): add className test case

This commit is contained in:
chenjiahan
2020-11-20 14:26:41 +08:00
committed by neverland
parent 99b52726b6
commit 178a41a8b0
2 changed files with 20 additions and 3 deletions
+11
View File
@@ -47,6 +47,17 @@ test('should close popover when clicking the action', () => {
expect(wrapper.emitted('input').length).toEqual(1);
});
test('should allow to custom the className of action', () => {
const wrapper = mount(Popover, {
propsData: {
value: true,
actions: [{ text: 'Option', className: 'foo' }],
},
});
expect(wrapper.find('.van-popover__action').html()).toMatchSnapshot();
});
test('should not init popper.js instance before showed', async () => {
const wrapper = mount(Popover);
expect(wrapper.vm.popper).toBeFalsy();