ApiKeysAddedModal.test.tsx 570 B

123456789101112131415161718192021222324252627
  1. import { shallow } from 'enzyme';
  2. import React from 'react';
  3. import { ApiKeysAddedModal, Props } from './ApiKeysAddedModal';
  4. const setup = (propOverrides?: object) => {
  5. const props: Props = {
  6. onDismiss: jest.fn(),
  7. apiKey: 'api key test',
  8. rootPath: 'test/path',
  9. };
  10. Object.assign(props, propOverrides);
  11. const wrapper = shallow(<ApiKeysAddedModal {...props} />);
  12. return {
  13. wrapper,
  14. };
  15. };
  16. describe('Render', () => {
  17. it('should render component', () => {
  18. const { wrapper } = setup();
  19. expect(wrapper).toMatchSnapshot();
  20. });
  21. });