blob: ed616ff5122d7427a4f142d0e20b229d13a80bb1 [file] [log] [blame]
Ed Tanous7d6b44c2024-03-23 14:56:34 -07001import { mount } from '@vue/test-utils';
Sukanya Pandeye8814992021-01-04 12:05:30 +05302import InputPasswordToggle from '@/components/Global/InputPasswordToggle';
Sukanya Pandeye8814992021-01-04 12:05:30 +05303
4describe('InputPasswordToggle.vue', () => {
5 const wrapper = mount(InputPasswordToggle, {
Sukanya Pandeye8814992021-01-04 12:05:30 +05306 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});