Sha256: 8301334fe885b0596fcdcdfe4726cd39dfbce9f5d7904603993f85f81a891fbe

Contents?: true

Size: 1.13 KB

Versions: 33

Compression:

Stored size: 1.13 KB

Contents

import React from 'react';
import { act } from 'react-test-renderer';
import { renderWithRedux, patientlyWaitFor } from 'react-testing-lib-wrapper';
import { CONTENT_KEY } from '../../../scenes/Content/ContentConstants';
import GenericContentPage from '../GenericContentPage';

const renderOptions = () => ({
  apiNamespace: CONTENT_KEY,
});

test('Can render the basic component with no data', async (done) => {
  const contentHeader = 'Content Header';
  const content = { results: [] };
  const onSearch = jest.fn();
  const updateSearchQuery = jest.fn();
  const searchQuery = '';
  const onPaginationChange = jest.fn();
  const TableSchema = [];
  const bookmarkController = 'module_streams';

  const { getByText } = renderWithRedux(<GenericContentPage
    header={contentHeader}
    content={content}
    tableSchema={TableSchema}
    onSearch={onSearch}
    updateSearchQuery={updateSearchQuery}
    initialInputValue={searchQuery}
    onPaginationChange={onPaginationChange}
    bookmarkController={bookmarkController}
  />, renderOptions());

  await patientlyWaitFor(() =>
    expect(getByText(contentHeader)).toBeInTheDocument());
  act(done);
});

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
katello-4.15.0.rc2 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.15.0.rc1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.14.1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.14.0 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.14.0.rc3 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.14.0.rc2 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.14.0.rc1.1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.14.0.rc1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.13.1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.13.0 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.12.1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.13.0.rc1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.12.0 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.12.0.rc3 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.12.0.rc2 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.12.0.rc1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.11.1 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.11.0 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.11.0.rc2 webpack/components/Content/__tests__/GenericContentPage.test.js
katello-4.11.0.rc1 webpack/components/Content/__tests__/GenericContentPage.test.js