import Adapter from 'enzyme-adapter-react-16'; import ApiHelpers from '../js/components/util/ApiHelpers.jsx'; import BaseTable from '../js/components/BaseTable.jsx'; import { expect } from 'chai'; import { MetricsTableBase } from '../js/components/MetricsTable.jsx'; import React from 'react'; import Enzyme, { shallow } from 'enzyme'; Enzyme.configure({ adapter: new Adapter() }); describe('Tests for ', () => { const defaultProps = { api: ApiHelpers(''), }; it('renders the table with all columns', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).to.have.length(1); expect(table.props().dataSource).to.have.length(1); expect(table.props().columns).to.have.length(9); }); it('omits the namespace column for the namespace resource', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).to.have.length(1); expect(table.props().columns).to.have.length(8); }); it('omits the namespace column when showNamespaceColumn is false', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).to.have.length(1); expect(table.props().columns).to.have.length(8); }); it('omits meshed column for authority resource', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).to.have.length(1); expect(table.props().columns).to.have.length(8); }); });