Ed Tanous | 7d6b44c | 2024-03-23 14:56:34 -0700 | [diff] [blame] | 1 | import { mount } from '@vue/test-utils'; |
Sukanya Pandey | 4da9495 | 2020-12-29 15:35:01 +0530 | [diff] [blame] | 2 | import TableCellCount from '@/components/Global/TableCellCount'; |
| 3 | |
Sukanya Pandey | 4da9495 | 2020-12-29 15:35:01 +0530 | [diff] [blame] | 4 | describe('TableCellCount.vue', () => { |
| 5 | const wrapper = mount(TableCellCount, { |
Sukanya Pandey | 4da9495 | 2020-12-29 15:35:01 +0530 | [diff] [blame] | 6 | propsData: { |
| 7 | filteredItemsCount: 5, |
| 8 | totalNumberOfCells: 100, |
| 9 | }, |
| 10 | mocks: { |
| 11 | $t: (key) => key, |
| 12 | }, |
| 13 | }); |
| 14 | it('should exist', () => { |
| 15 | expect(wrapper.exists()).toBe(true); |
| 16 | }); |
| 17 | it('should render filtered and totalnumber of items', () => { |
| 18 | expect(wrapper.text()).toContain('global.table.selectedItems'); |
| 19 | }); |
| 20 | it('should render only totalnumber of items', async () => { |
| 21 | await wrapper.setProps({ filteredItemsCount: 5, totalNumberOfCells: 5 }); |
| 22 | expect(wrapper.text()).toContain('global.table.items'); |
| 23 | }); |
| 24 | it('should render correctly', () => { |
| 25 | expect(wrapper.element).toMatchSnapshot(); |
| 26 | }); |
| 27 | }); |