Sha256: 380398dd4f40071a1f10970b002f48ba89dbc4e41ab8c1a1c9387f266c4da42b

Contents?: true

Size: 1.21 KB

Versions: 87

Compression:

Stored size: 1.21 KB

Contents

import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import ContentPage from '../ContentPage';
import ContentTable from '../ContentTable';
import Search from '../../../components/Search/index';

jest.mock('foremanReact/components/Pagination/PaginationWrapper', () => (<div>Pagination Mock</div>));

describe('Content page', () => {
  it('should render and contain appropriate components', async () => {
    const contentHeader = 'Content Header';
    const content = {};
    const onSearch = () => {};
    const getAutoCompleteParams = () => {};
    const updateSearchQuery = () => {};
    const searchQuery = '';
    const onPaginationChange = () => {};
    const TableSchema = [];

    const wrapper = shallow(<ContentPage
      header={contentHeader}
      content={content}
      tableSchema={TableSchema}
      onSearch={onSearch}
      getAutoCompleteParams={getAutoCompleteParams}
      updateSearchQuery={updateSearchQuery}
      initialInputValue={searchQuery}
      onPaginationChange={onPaginationChange}
    />);

    expect(toJson(wrapper)).toMatchSnapshot();
    expect(wrapper.find(ContentTable)).toHaveLength(1);
    expect(wrapper.find(Search)).toHaveLength(1);
  });
});

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
katello-4.3.1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.2.2 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.3.0 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.3.0.rc4 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.3.0.rc3 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.3.0.rc2.1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.3.0.rc2 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.3.0.rc1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.2.1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.2.0.1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.1.4 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.0.3 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.2.0.1.rc3 webpack/components/Content/__tests__/ContentPage.test.js
katello-3.18.5 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.2.0.1.rc2 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.2.0.rc2 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.1.3 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.2.0.rc1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.0.2.1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.1.2.1 webpack/components/Content/__tests__/ContentPage.test.js