mirror of
https://github.com/apache/superset.git
synced 2026-04-09 11:25:23 +00:00
Eslint error cleanup (#10657)
* moving two console errors to logger errors * nixing unused map index * nixing unused param * linting * changing an alert to a toast * fixing tests * lint fix * one letter change, just to see if iti gets CI to pass this test.
This commit is contained in:
@@ -18,13 +18,18 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
import { Provider } from 'react-redux';
|
||||
import configureStore from 'redux-mock-store';
|
||||
|
||||
import Link from 'src/components/Link';
|
||||
import TableElement from 'src/SqlLab/components/TableElement';
|
||||
import ColumnElement from 'src/SqlLab/components/ColumnElement';
|
||||
|
||||
import { mockedActions, table } from './fixtures';
|
||||
|
||||
describe('TableElement', () => {
|
||||
const mockStore = configureStore([]);
|
||||
const store = mockStore({});
|
||||
const mockedProps = {
|
||||
actions: mockedActions,
|
||||
table,
|
||||
@@ -45,7 +50,11 @@ describe('TableElement', () => {
|
||||
expect(wrapper.find(ColumnElement)).toHaveLength(14);
|
||||
});
|
||||
it('mounts', () => {
|
||||
mount(<TableElement {...mockedProps} />);
|
||||
mount(
|
||||
<Provider store={store}>
|
||||
<TableElement {...mockedProps} />
|
||||
</Provider>,
|
||||
);
|
||||
});
|
||||
it('sorts columns', () => {
|
||||
const wrapper = shallow(<TableElement {...mockedProps} />);
|
||||
@@ -58,7 +67,11 @@ describe('TableElement', () => {
|
||||
);
|
||||
});
|
||||
it('calls the collapseTable action', () => {
|
||||
const wrapper = mount(<TableElement {...mockedProps} />);
|
||||
const wrapper = mount(
|
||||
<Provider store={store}>
|
||||
<TableElement {...mockedProps} />
|
||||
</Provider>,
|
||||
);
|
||||
expect(mockedActions.collapseTable.called).toBe(false);
|
||||
wrapper.find('.table-name').simulate('click');
|
||||
expect(mockedActions.collapseTable.called).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user