1import { mount, createLocalVue } from '@vue/test-utils'; 2import TableToolbar from '@/components/Global/TableToolbar'; 3import BootstrapVue from 'bootstrap-vue'; 4 5const localVue = createLocalVue(); 6localVue.use(BootstrapVue); 7describe('TableToolbar.vue', () => { 8 const wrapper = mount(TableToolbar, { 9 localVue, 10 propsData: { 11 selectedItemsCount: 0, 12 }, 13 mocks: { 14 $t: (key) => key, 15 }, 16 }); 17 it('should exist', () => { 18 expect(wrapper.exists()).toBe(true); 19 }); 20 it('should render class toolbar-container when selectedItemsCount is greater than 0', async () => { 21 await wrapper.setProps({ selectedItemsCount: 12 }); 22 expect(wrapper.find('.toolbar-container').exists()).toBe(true); 23 }); 24 it('should render correctly', () => { 25 expect(wrapper.element).toMatchSnapshot(); 26 }); 27}); 28