import ApiHelpers from './util/ApiHelpers.jsx'; import BaseTable from './BaseTable.jsx'; import { MetricsTableBase } from './MetricsTable.jsx'; import React from 'react'; import { shallow } from 'enzyme'; describe('Tests for ', () => { const defaultProps = { api: ApiHelpers(''), }; it('renders the table with all columns', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).toHaveLength(1); expect(table.props().dataSource).toHaveLength(1); expect(table.props().columns).toHaveLength(10); }); it('omits the namespace column for the namespace resource', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).toHaveLength(1); expect(table.props().columns).toHaveLength(9); }); it('omits the namespace column when showNamespaceColumn is false', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).toHaveLength(1); expect(table.props().columns).toHaveLength(9); }); it('omits meshed column and grafana column for authority resource', () => { const component = shallow( ); const table = component.find(BaseTable); expect(table).toHaveLength(1); expect(table.props().columns).toHaveLength(8); }); });