blob: 1cfee4c827e8e08f5b50277f4123530b21a066e9 [file] [log] [blame]
Ed Tanous7d6b44c2024-03-23 14:56:34 -07001import { mount } from '@vue/test-utils';
Sukanya Pandey88ac70f2020-12-31 14:27:22 +05302import StatusIcon from '@/components/Global/StatusIcon';
3
Sukanya Pandey88ac70f2020-12-31 14:27:22 +05304describe('StatusIcon.vue', () => {
5 const wrapper = mount(StatusIcon, {
Sukanya Pandey88ac70f2020-12-31 14:27:22 +05306 propsData: {
7 status: 'info',
8 },
9 });
10 it('should exist', () => {
11 expect(wrapper.exists()).toBe(true);
12 });
13 it('should render icon-info element', () => {
14 expect(wrapper.find('.info').exists()).toBe(true);
15 });
16 it('should render icon-success element', async () => {
17 await wrapper.setProps({ status: 'success' });
18 expect(wrapper.find('.success').exists()).toBe(true);
19 });
20 it('should render icon-warning element', async () => {
21 await wrapper.setProps({ status: 'warning' });
22 expect(wrapper.find('.warning').exists()).toBe(true);
23 });
24 it('should render icon-danger element', async () => {
25 await wrapper.setProps({ status: 'danger' });
26 expect(wrapper.find('.danger').exists()).toBe(true);
27 });
28 it('should render icon-secondary element', async () => {
29 await wrapper.setProps({ status: 'secondary' });
30 expect(wrapper.find('.status-icon').exists()).toBe(true);
31 });
32 it('should render correctly', () => {
33 expect(wrapper.element).toMatchSnapshot();
34 });
35});