import ImagesSharedSnackbar from '@/components/modal/snackbars/ImagesSharedSnackbar.vue'; import { mount } from '@vue/test-utils'; import { VSnackbar } from 'vuetify/components'; describe('ImagesSharedSnackbar', () => { it('should open snack bar when ModelValue is set to true', async () => { const wrapper = mount(ImagesSharedSnackbar); const snack = wrapper.findComponent(VSnackbar); await snack.setValue(true); expect(snack.isVisible()).toBe(true); }); it('should emit update:modelValue when close button is clicked and close the snackbar', async () => { const wrapper = mount(ImagesSharedSnackbar, { props: { modelValue: true }, }); const closeButton = wrapper.findComponent('[data-testid="closeBtn"]'); await closeButton.trigger('click'); expect(wrapper.emitted('update:modelValue')).toBeTruthy(); }); });