Sha256: bca369a12633d30ab907270a9c9cc3e71596d7c8859c5f123336e75d8d74bd33

Contents?: true

Size: 1.1 KB

Versions: 28

Compression:

Stored size: 1.1 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';

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

28 entries across 28 versions & 1 rubygems

Version Path
katello-4.5.0.rc2 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.4.1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.5.0.rc1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.4.0.2 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.4.0.1 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.4.0 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.4.0.rc2 webpack/components/Content/__tests__/ContentPage.test.js
katello-4.4.0.rc1 webpack/components/Content/__tests__/ContentPage.test.js