Sha256: b31591e50376b800fb4ac2738d3d34d75018248aa90c781e101a9cf6df9e5fcd

Contents?: true

Size: 1.02 KB

Versions: 160

Compression:

Stored size: 1.02 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);
    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);
    const page = mount(<Component store={store} />);
    expect(toJson(page)).toMatchSnapshot();
  });
});

Version data entries

160 entries across 160 versions & 1 rubygems

Version Path
katello-4.14.2 webpack/components/WithOrganization/withOrganization.test.js
katello-4.15.0 webpack/components/WithOrganization/withOrganization.test.js
katello-4.15.0.rc2 webpack/components/WithOrganization/withOrganization.test.js
katello-4.15.0.rc1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.14.1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.14.0 webpack/components/WithOrganization/withOrganization.test.js
katello-4.14.0.rc3 webpack/components/WithOrganization/withOrganization.test.js
katello-4.14.0.rc2 webpack/components/WithOrganization/withOrganization.test.js
katello-4.14.0.rc1.1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.14.0.rc1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.13.1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.13.0 webpack/components/WithOrganization/withOrganization.test.js
katello-4.12.1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.13.0.rc1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.12.0 webpack/components/WithOrganization/withOrganization.test.js
katello-4.12.0.rc3 webpack/components/WithOrganization/withOrganization.test.js
katello-4.12.0.rc2 webpack/components/WithOrganization/withOrganization.test.js
katello-4.12.0.rc1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.11.1 webpack/components/WithOrganization/withOrganization.test.js
katello-4.11.0 webpack/components/WithOrganization/withOrganization.test.js