kafka-ui/kafka-ui-react-app/src/components/Schemas/New/__test__/New.spec.tsx
Guzel738 44cf449a8f
Create Schema Registry form (#209)
* First commit

* Create Schema Form. Refactoring

* Specs for Create Schema Registry form created

* Update thunks.spec.ts

* Update actions.spec.ts

Co-authored-by: Oleg Shuralev <workshur@gmail.com>
2021-02-28 22:39:09 +03:00

37 lines
1,007 B
TypeScript

import React from 'react';
import configureStore from 'redux/store/configureStore';
import { mount, shallow } from 'enzyme';
import { Provider } from 'react-redux';
import { StaticRouter } from 'react-router-dom';
import NewContainer from '../NewContainer';
import New, { NewProps } from '../New';
describe('New', () => {
describe('Container', () => {
const store = configureStore();
it('renders view', () => {
const component = shallow(
<Provider store={store}>
<NewContainer />
</Provider>
);
expect(component.exists()).toBeTruthy();
});
});
describe('View', () => {
const pathname = '/ui/clusters/clusterName/schemas/new';
const setupWrapper = (props: Partial<NewProps> = {}) => (
<StaticRouter location={{ pathname }} context={{}}>
<New createSchema={jest.fn()} {...props} />
</StaticRouter>
);
it('matches snapshot', () => {
expect(mount(setupWrapper())).toMatchSnapshot();
});
});
});