blob: 7ab73bf31244cc54b76bb148efb0e2cb18a930ef [file] [log] [blame]
Ed Tanous7d6b44c2024-03-23 14:56:34 -07001import { mount } from '@vue/test-utils';
Sukanya Pandey4da94952020-12-29 15:35:01 +05302import TableCellCount from '@/components/Global/TableCellCount';
3
Sukanya Pandey4da94952020-12-29 15:35:01 +05304describe('TableCellCount.vue', () => {
5 const wrapper = mount(TableCellCount, {
Sukanya Pandey4da94952020-12-29 15:35:01 +05306 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});