OrgProfile.test.tsx 525 B

1234567891011121314151617181920212223242526272829
  1. import { shallow } from 'enzyme';
  2. import React from 'react';
  3. import OrgProfile, { Props } from './OrgProfile';
  4. jest.mock('app/core/core', () => {
  5. return {
  6. contextSrv: {
  7. hasPermission: () => true,
  8. },
  9. };
  10. });
  11. const setup = () => {
  12. const props: Props = {
  13. orgName: 'Main org',
  14. onSubmit: jest.fn(),
  15. };
  16. return shallow(<OrgProfile {...props} />);
  17. };
  18. describe('Render', () => {
  19. it('should render component', () => {
  20. const wrapper = setup();
  21. expect(wrapper).toMatchSnapshot();
  22. });
  23. });