SurenNeware | 6b42678 | 2020-12-31 20:46:40 +0530 | [diff] [blame] | 1 | import { mount, createLocalVue } from '@vue/test-utils'; |
| 2 | import InfoTooltip from '@/components/Global/InfoTooltip'; |
| 3 | |
| 4 | const localVue = createLocalVue(); |
| 5 | |
| 6 | describe('InfoTooltip.vue', () => { |
| 7 | const wrapper = mount(InfoTooltip, { |
| 8 | localVue, |
| 9 | propsData: { |
| 10 | title: 'A tooltip test title', |
| 11 | }, |
| 12 | mocks: { |
| 13 | $t: (key) => key, |
| 14 | }, |
| 15 | }); |
| 16 | it('should exist', () => { |
| 17 | expect(wrapper.exists()).toBe(true); |
| 18 | }); |
| 19 | it('should render title attribute for button', () => { |
| 20 | expect(wrapper.attributes('title')).toBe('title'); |
| 21 | }); |
| 22 | it('should render icon-tooltip element', () => { |
| 23 | expect(wrapper.find('icon-tooltip').exists()).toBe(true); |
| 24 | }); |
| 25 | it('should render correctly', () => { |
| 26 | expect(wrapper.element).toMatchSnapshot(); |
| 27 | }); |
| 28 | }); |