blob: 025d67bb2009f4af1e7b090cfb9e1f39c8bfd560 [file] [log] [blame]
Sukanya Pandey4da94952020-12-29 15:35:01 +05301import { mount, createLocalVue } from '@vue/test-utils';
2import TableCellCount from '@/components/Global/TableCellCount';
3
4const localVue = createLocalVue();
5
6describe('TableCellCount.vue', () => {
7 const wrapper = mount(TableCellCount, {
8 localVue,
9 propsData: {
10 filteredItemsCount: 5,
11 totalNumberOfCells: 100,
12 },
13 mocks: {
14 $t: (key) => key,
15 },
16 });
17 it('should exist', () => {
18 expect(wrapper.exists()).toBe(true);
19 });
20 it('should render filtered and totalnumber of items', () => {
21 expect(wrapper.text()).toContain('global.table.selectedItems');
22 });
23 it('should render only totalnumber of items', async () => {
24 await wrapper.setProps({ filteredItemsCount: 5, totalNumberOfCells: 5 });
25 expect(wrapper.text()).toContain('global.table.items');
26 });
27 it('should render correctly', () => {
28 expect(wrapper.element).toMatchSnapshot();
29 });
30});