blob: a3bcf3b914fba1dac828a75ee6b1d7a00622c9ac [file] [log] [blame]
Ed Tanous7d6b44c2024-03-23 14:56:34 -07001import { mount } from '@vue/test-utils';
Sukanya Pandeyd348c442021-01-05 11:28:36 +05302import TableToolbar from '@/components/Global/TableToolbar';
Sukanya Pandeyd348c442021-01-05 11:28:36 +05303
Sukanya Pandeyd348c442021-01-05 11:28:36 +05304describe('TableToolbar.vue', () => {
5 const wrapper = mount(TableToolbar, {
Sukanya Pandeyd348c442021-01-05 11:28:36 +05306 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});