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

@@ -20,12 +20,17 @@ import React from 'react';
import { shallow, mount } from 'enzyme';
import { OverlayTrigger } from 'react-bootstrap';
import sinon from 'sinon';
import { Provider } from 'react-redux';
import configureStore from 'redux-mock-store';
import EmbedCodeButton from 'src/explore/components/EmbedCodeButton';
import * as exploreUtils from 'src/explore/exploreUtils';
import * as common from 'src/utils/common';
describe('EmbedCodeButton', () => {
const mockStore = configureStore([]);
const store = mockStore({});
const defaultProps = {
latestQueryFormData: { datasource: '107__table' },
};
@@ -41,11 +46,16 @@ describe('EmbedCodeButton', () => {
expect(wrapper.find(OverlayTrigger)).toExist();
});
it('should create shorten, standalone, explore url', () => {
it('should create a short, standalone, explore url', () => {
const spy1 = sinon.spy(exploreUtils, 'getExploreLongUrl');
const spy2 = sinon.spy(common, 'getShortUrl');
const wrapper = mount(<EmbedCodeButton {...defaultProps} />);
const wrapper = mount(<EmbedCodeButton {...defaultProps} />, {
wrappingComponent: Provider,
wrappingComponentProps: {
store,
},
});
wrapper.setState({
height: '1000',
width: '2000',