Files
superset2/superset/assets/spec/javascripts/CRUD/CollectionTable_spec.jsx
Chris Williams b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00

34 lines
812 B
JavaScript

import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import CollectionTable from '../../../src/CRUD/CollectionTable';
import mockDatasource from '../../fixtures/mockDatasource';
const props = {
collection: mockDatasource['7__table'].columns,
tableColumns: ['column_name', 'type', 'groupby'],
};
describe('CollectionTable', () => {
let wrapper;
let el;
beforeEach(() => {
el = <CollectionTable {...props} />;
wrapper = shallow(el);
});
it('is valid', () => {
expect(React.isValidElement(el)).to.equal(true);
});
it('renders a table', () => {
const length = mockDatasource['7__table'].columns.length;
expect(wrapper.find('table')).to.have.lengthOf(1);
expect(wrapper.find('tbody tr.row')).to.have.lengthOf(length);
});
});