Files
superset2/superset/assets/spec/javascripts/sqllab/SqlEditorLeftBar_spec.jsx
Denny Biasiolli 3cd16cf368 Fix test's warnings (#2697)
* tests: adding required props to FilterableTable mockedProps

* tests: adding required prop `height` to QuerySearch mockedProps

* tests: adding required prop `height` to ResultSet mockedProps

* tests: adding required prop `height` to SqlEditorLeftBar mockedProps

* tests: fix warning in Timer component
2017-04-30 10:58:09 -07:00

27 lines
799 B
JavaScript

import React from 'react';
import { mount } from 'enzyme';
import { describe, it } from 'mocha';
import { expect } from 'chai';
import { table, defaultQueryEditor } from './fixtures';
import SqlEditorLeftBar from '../../../javascripts/SqlLab/components/SqlEditorLeftBar';
import TableElement from '../../../javascripts/SqlLab/components/TableElement';
describe('SqlEditorLeftBar', () => {
const mockedProps = {
tables: [table],
queryEditor: defaultQueryEditor,
height: 0,
};
it('is valid', () => {
expect(
React.isValidElement(<SqlEditorLeftBar {...mockedProps} />),
).to.equal(true);
});
it('renders a TableElement', () => {
const wrapper = mount(<SqlEditorLeftBar {...mockedProps} />);
expect(wrapper.find(TableElement)).to.have.length(1);
});
});