1import { mount } from '@vue/test-utils'; 2import InputPasswordToggle from '@/components/Global/InputPasswordToggle'; 3 4describe('InputPasswordToggle.vue', () => { 5 const wrapper = mount(InputPasswordToggle, { 6 data() { 7 return { 8 isVisible: false, 9 }; 10 }, 11 mocks: { 12 $t: (key) => key, 13 }, 14 }); 15 it('should exist', () => { 16 expect(wrapper.exists()).toBe(true); 17 }); 18 it('should not render isVisible class', () => { 19 expect(wrapper.find('.isVisible').exists()).toBe(false); 20 }); 21 it('should render isVisible class when button is clicked', async () => { 22 await wrapper.find('button').trigger('click'); 23 expect(wrapper.find('.isVisible').exists()).toBe(true); 24 }); 25 it('should render correctly', () => { 26 expect(wrapper.element).toMatchSnapshot(); 27 }); 28}); 29