primevue-mirror/components/overlaypanel/OverlayPanel.spec.js

34 lines
968 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';
2022-09-06 12:03:37 +00:00
import OverlayPanel from './OverlayPanel.vue';
describe('OverlayPanel.vue', () => {
let wrapper;
beforeEach(async () => {
wrapper = mount(OverlayPanel, {
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-overlaypanel.p-component').exists()).toBe(true);
expect(wrapper.find('.p-overlaypanel-content').exists()).toBe(true);
expect(wrapper.find('.p-overlaypanel-content').text()).toBe('PrimeVue');
expect(wrapper.find('.p-overlaypanel-close').exists()).toBe(true);
});
2022-09-14 11:26:01 +00:00
});