refactor: Refactor QueryTable to use react-table (#11216)

* Refactor QueryTable to use react-table

* Fix lodash import

* Fix tests

* Fix imports and QuerySearch styles

* Update superset-frontend/src/SqlLab/components/QuerySearch.jsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/SqlLab/components/QuerySearch.jsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Lint fix

* Refactored QueryTable into functional component

* Remove calculating content height

* Lint fix

Co-authored-by: Evan Rusackas <evan@preset.io>
This commit is contained in:
Kamil Gabryjelski
2020-10-19 07:32:13 +02:00
committed by GitHub
parent a1f8429b4e
commit 735123d1f5
5 changed files with 90 additions and 112 deletions

View File

@@ -21,7 +21,6 @@ import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { shallow } from 'enzyme';
import sinon from 'sinon';
import App from 'src/SqlLab/components/App';
import TabbedSqlEditors from 'src/SqlLab/components/TabbedSqlEditors';
@@ -41,14 +40,6 @@ describe('SqlLab App', () => {
expect(React.isValidElement(<App />)).toBe(true);
});
it('should handler resize', () => {
const inner = wrapper.dive();
sinon.spy(inner.instance(), 'getHeight');
inner.instance().handleResize();
expect(inner.instance().getHeight.callCount).toBe(1);
inner.instance().getHeight.restore();
});
it('should render', () => {
const inner = wrapper.dive();
expect(inner.find('.SqlLab')).toHaveLength(1);