diff options
Diffstat (limited to 'tests/unit/Global/TableCellCount.spec.js')
-rw-r--r-- | tests/unit/Global/TableCellCount.spec.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/Global/TableCellCount.spec.js b/tests/unit/Global/TableCellCount.spec.js new file mode 100644 index 00000000..025d67bb --- /dev/null +++ b/tests/unit/Global/TableCellCount.spec.js @@ -0,0 +1,30 @@ +import { mount, createLocalVue } from '@vue/test-utils'; +import TableCellCount from '@/components/Global/TableCellCount'; + +const localVue = createLocalVue(); + +describe('TableCellCount.vue', () => { + const wrapper = mount(TableCellCount, { + localVue, + propsData: { + filteredItemsCount: 5, + totalNumberOfCells: 100, + }, + mocks: { + $t: (key) => key, + }, + }); + it('should exist', () => { + expect(wrapper.exists()).toBe(true); + }); + it('should render filtered and totalnumber of items', () => { + expect(wrapper.text()).toContain('global.table.selectedItems'); + }); + it('should render only totalnumber of items', async () => { + await wrapper.setProps({ filteredItemsCount: 5, totalNumberOfCells: 5 }); + expect(wrapper.text()).toContain('global.table.items'); + }); + it('should render correctly', () => { + expect(wrapper.element).toMatchSnapshot(); + }); +}); |