
* 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>
37 lines
1,007 B
TypeScript
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();
|
|
});
|
|
});
|
|
});
|