import { mount } from '@vue/test-utils' import { render } from '@testing-library/vue' import BaseButton from '@/elements/button/BaseButton.vue' describe('BaseButton.vue', () => { it('should be a Vue instance when mounted', () => { const wrapper = mount(BaseButton) expect(wrapper.isVueInstance()).toBeTruthy() }) it('should render correctly when mounted', () => { const wrapper = mount(BaseButton) expect(wrapper.element).toMatchSnapshot() }) it('should emit a click event when clicked', async () => { const wrapper = mount(BaseButton) wrapper.find('button').trigger('click') expect(wrapper.emitted('click')).toBeTruthy() }) })