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