import { mount } from '@vue/test-utils'; import InputText from 'primevue/inputtext'; import Inplace from './Inplace.vue'; describe('Inplace.vue', () => { it('should exist', () => { const wrapper = mount(Inplace); expect(wrapper.find('.p-inplace.p-component').exists()).toBe(true); }); it('should slots display', () => { const wrapper = mount(Inplace, { global: { components: { InputText } }, slots: { display: ` View Picture `, content: `` } }); expect(wrapper.find('.p-inplace-display').exists()).toBe(true); wrapper.vm.open({}); expect(wrapper.emitted()['update:active'][0]).toEqual([true]); wrapper.vm.close({}); expect(wrapper.emitted()['update:active'][1]).toEqual([false]); }); });