Sha256: 13b636832f0ca68cf02e9b9dada25aebdb06b65002394efd43890e4242ded91c
Contents?: true
Size: 1.14 KB
Versions: 56
Compression:
Stored size: 1.14 KB
Contents
import React from 'react'; import { shallow } from 'enzyme'; import toJson from 'enzyme-to-json'; import ContentTable from '../ContentTable'; import { LoadingState } from '../../../components/LoadingState'; import { Table } from '../../../components/pf3Table'; 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
56 entries across 56 versions & 1 rubygems