Ed Tanous | 7d6b44c | 2024-03-23 14:56:34 -0700 | [diff] [blame^] | 1 | import { mount } from '@vue/test-utils'; |
Sukanya Pandey | d348c44 | 2021-01-05 11:28:36 +0530 | [diff] [blame] | 2 | import TableToolbar from '@/components/Global/TableToolbar'; |
Sukanya Pandey | d348c44 | 2021-01-05 11:28:36 +0530 | [diff] [blame] | 3 | |
Sukanya Pandey | d348c44 | 2021-01-05 11:28:36 +0530 | [diff] [blame] | 4 | describe('TableToolbar.vue', () => { |
| 5 | const wrapper = mount(TableToolbar, { |
Sukanya Pandey | d348c44 | 2021-01-05 11:28:36 +0530 | [diff] [blame] | 6 | propsData: { |
| 7 | selectedItemsCount: 0, |
| 8 | }, |
| 9 | mocks: { |
| 10 | $t: (key) => key, |
| 11 | }, |
| 12 | }); |
| 13 | it('should exist', () => { |
| 14 | expect(wrapper.exists()).toBe(true); |
| 15 | }); |
| 16 | it('should render class toolbar-container when selectedItemsCount is greater than 0', async () => { |
| 17 | await wrapper.setProps({ selectedItemsCount: 12 }); |
| 18 | expect(wrapper.find('.toolbar-container').exists()).toBe(true); |
| 19 | }); |
| 20 | it('should render correctly', () => { |
| 21 | expect(wrapper.element).toMatchSnapshot(); |
| 22 | }); |
| 23 | }); |