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