Sha256: 53065e40f5edfa5695851127000c70ea6dd17517cd802f209a706f6c400deaed

Contents?: true

Size: 1.16 KB

Versions: 31

Compression:

Stored size: 1.16 KB

Contents

import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import ContentTable from '../ContentTable';
import { Table } from '../../../move_to_foreman/components/common/table';
import { LoadingState } from '../../../move_to_pf/LoadingState';

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

describe('Content Table', () => {
  it('should render and contain appropriate components', async () => {
    const content = {
      loading: false,
      results: [
        {
          dummy_content_id: 1,
          dummy_content_name: 'dummy_name_1',
        },
        {
          dummy_content_id: 2,
          dummy_content_name: 'dummy_name_2',
        },
      ],
      pagination: {},
      itemCount: 2,
    };
    const onPaginationChange = () => {};
    const TableSchema = [];

    const wrapper = shallow(<ContentTable
      content={content}
      tableSchema={TableSchema}
      onPaginationChange={onPaginationChange}
    />);

    expect(toJson(wrapper)).toMatchSnapshot();
    expect(wrapper.find(Table)).toHaveLength(1);
    expect(wrapper.find(LoadingState)).toHaveLength(1);
  });
});

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
katello-3.15.0.1 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.15.0 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.15.0.rc2 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.15.0.rc1.3 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.15.0.rc1.2 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.15.0.rc1.1 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.15.0.rc1 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.14.1 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.14.0 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.14.0.rc2 webpack/components/Content/__tests__/ContentTable.test.js
katello-3.14.0.rc1 webpack/components/Content/__tests__/ContentTable.test.js