Fix tests errors and warnings - iteration 4 (#12212) (#12223)

This commit is contained in:
Michael S. Molina
2021-01-26 04:24:41 -03:00
committed by GitHub
parent 0fc9da6be7
commit 0c08bb87c3
10 changed files with 62 additions and 38 deletions

View File

@@ -20,7 +20,7 @@ import { Provider } from 'react-redux';
import React from 'react';
import { shallow, mount } from 'enzyme';
import sinon from 'sinon';
import fetchMock from 'fetch-mock';
import { ParentSize } from '@vx/responsive';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
import { Sticky, StickyContainer } from 'react-sticky';
@@ -44,6 +44,8 @@ import WithDragDropContext from 'spec/helpers/WithDragDropContext';
const dashboardLayout = undoableDashboardLayout.present;
const layoutWithTabs = undoableDashboardLayoutWithTabs.present;
fetchMock.get('glob:*/csstemplateasyncmodelview/api/read', {});
describe('DashboardBuilder', () => {
let favStarStub;
@@ -67,6 +69,7 @@ describe('DashboardBuilder', () => {
colorScheme: undefined,
handleComponentDrop() {},
setDirectPathToChild: sinon.spy(),
setMountedTab() {},
};
function setup(overrideProps, useProvider = false, store = mockStore) {

View File

@@ -39,6 +39,8 @@ describe('DashboardGrid', () => {
handleComponentDrop() {},
resizeComponent() {},
width: 500,
isComponentVisible: true,
setDirectPathToChild() {},
};
function setup(overrideProps) {

View File

@@ -22,7 +22,7 @@ import { shallow } from 'enzyme';
import sinon from 'sinon';
import { LineEditableTabs } from 'src/common/components/Tabs';
import { Modal } from 'src/common/components';
import fetchMock from 'fetch-mock';
import { styledMount as mount } from 'spec/helpers/theming';
import DashboardComponent from 'src/dashboard/containers/DashboardComponent';
import DeleteComponentButton from 'src/dashboard/components/DeleteComponentButton';
@@ -35,6 +35,8 @@ import { dashboardLayoutWithTabs } from 'spec/fixtures/mockDashboardLayout';
import { mockStoreWithTabs } from 'spec/fixtures/mockStore';
describe('Tabs', () => {
fetchMock.post('glob:*/r/shortner/', {});
const props = {
id: 'TABS_ID',
parentId: DASHBOARD_ROOT_ID,