Sha256: f651cb1b2bbf2d8aee661060f96998f9ad25d417d166a59026e1e54c14e97f9a
Contents?: true
Size: 1.04 KB
Versions: 8
Compression:
Stored size: 1.04 KB
Contents
import React from 'react'; import thunk from 'redux-thunk'; import configureMockStore from 'redux-mock-store'; import { mount } from 'enzyme'; import toJson from 'enzyme-to-json'; import withOrganization from './withOrganization'; jest.mock('../SelectOrg/SetOrganization'); const mockStore = configureMockStore([thunk]); const store = mockStore({ katello: { organization: {} } }); describe('subscriptions page', () => { const WrappedComponent = () => <div> Wrapped! </div>; it('should render the wrapped component', () => { global.document.getElementById = () => ({ dataset: { id: 1 } }); const Component = withOrganization(WrappedComponent, '/test'); const page = mount(<Component store={store} />); expect(toJson(page)).toMatchSnapshot(); }); it('should render select org page', () => { global.document.getElementById = () => ({ dataset: { id: '' } }); const Component = withOrganization(WrappedComponent, '/test'); const page = mount(<Component store={store} />); expect(toJson(page)).toMatchSnapshot(); }); });
Version data entries
8 entries across 8 versions & 1 rubygems