primevue-mirror/components/lib/popover/Popover.spec.js

34 lines
928 B
JavaScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { mount } from '@vue/test-utils';
2022-12-08 11:04:25 +00:00
import PrimeVue from 'primevue/config';
import Popover from './Popover.vue';
2022-09-06 12:03:37 +00:00
describe('Popover.vue', () => {
2022-09-06 12:03:37 +00:00
let wrapper;
beforeEach(async () => {
wrapper = mount(Popover, {
2022-09-06 12:03:37 +00:00
global: {
plugins: [PrimeVue],
stubs: {
teleport: true
}
},
props: {
2022-12-08 11:04:25 +00:00
showCloseIcon: true
2022-09-06 12:03:37 +00:00
},
slots: {
default: 'PrimeVue'
}
});
await wrapper.vm.toggle({}, {});
});
it('should exist', () => {
expect(wrapper.find('.p-popover.p-component').exists()).toBe(true);
expect(wrapper.find('.p-popover-content').exists()).toBe(true);
expect(wrapper.find('.p-popover-content').text()).toBe('PrimeVue');
expect(wrapper.find('.p-popover-close').exists()).toBe(true);
2022-09-06 12:03:37 +00:00
});
2022-09-14 11:26:01 +00:00
});