2018-09-11 07:14:03 -05:00
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
import { Props, TeamSettings } from './TeamSettings';
|
|
|
|
import { getMockTeam } from './__mocks__/teamMocks';
|
|
|
|
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
|
|
const props: Props = {
|
|
|
|
team: getMockTeam(),
|
|
|
|
updateTeam: jest.fn(),
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.assign(props, propOverrides);
|
|
|
|
|
|
|
|
const wrapper = shallow(<TeamSettings {...props} />);
|
2020-06-24 03:55:39 -05:00
|
|
|
const instance = wrapper.instance() as any;
|
2018-09-11 07:14:03 -05:00
|
|
|
|
|
|
|
return {
|
|
|
|
wrapper,
|
|
|
|
instance,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
describe('Render', () => {
|
|
|
|
it('should render component', () => {
|
|
|
|
const { wrapper } = setup();
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|