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:
Evan Rusackas
2020-08-24 14:04:27 -07:00
committed by GitHub
parent 9461f9c1e0
commit fdfb7cdfd2
7 changed files with 45 additions and 18 deletions

View File

@@ -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);