OrgActionBar.test.tsx 711 B

1234567891011121314151617181920212223242526272829303132
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import OrgActionBar, { Props } from './OrgActionBar';
  4. const setup = (propOverrides?: object) => {
  5. const props: Props = {
  6. searchQuery: '',
  7. showLayoutMode: true,
  8. setSearchQuery: jest.fn(),
  9. linkButton: { href: 'some/url', title: 'test' },
  10. };
  11. Object.assign(props, propOverrides);
  12. return shallow(<OrgActionBar {...props} />);
  13. };
  14. describe('Render', () => {
  15. it('should render component', () => {
  16. const wrapper = setup();
  17. expect(wrapper).toMatchSnapshot();
  18. });
  19. it('should hide layout mode', () => {
  20. const wrapper = setup({
  21. showLayoutMode: false,
  22. });
  23. expect(wrapper).toMatchSnapshot();
  24. });
  25. });