Ed Tanous | 7d6b44c | 2024-03-23 14:56:34 -0700 | [diff] [blame] | 1 | import { mount } from '@vue/test-utils'; |
Sukanya Pandey | 88ac70f | 2020-12-31 14:27:22 +0530 | [diff] [blame] | 2 | import StatusIcon from '@/components/Global/StatusIcon'; |
| 3 | |
Sukanya Pandey | 88ac70f | 2020-12-31 14:27:22 +0530 | [diff] [blame] | 4 | describe('StatusIcon.vue', () => { |
| 5 | const wrapper = mount(StatusIcon, { |
Sukanya Pandey | 88ac70f | 2020-12-31 14:27:22 +0530 | [diff] [blame] | 6 | 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 | }); |