xref: /openbmc/webui-vue/tests/unit/Global/TableToolbar.spec.js (revision 7d6b44cb263da09e575c7cb28cab88c1eb339c7b)
1import { mount } from '@vue/test-utils';
2import TableToolbar from '@/components/Global/TableToolbar';
3
4describe('TableToolbar.vue', () => {
5  const wrapper = mount(TableToolbar, {
6    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});
24