mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[SIP-4] replace dashboard ajax calls with SupersetClient (#5854)
* [core] replace dashboard ajax calls with SupersetClient * [core] fix SupersetClient dashboard tests * [dashboard][superset-client] don't error by parsing save dashboard response as json
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Provider } from 'react-redux';
|
||||
import React from 'react';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
|
||||
import ParentSize from '@vx/responsive/build/components/ParentSize';
|
||||
import { Sticky, StickyContainer } from 'react-sticky';
|
||||
@@ -11,6 +12,8 @@ import DashboardBuilder from '../../../../src/dashboard/components/DashboardBuil
|
||||
import DashboardComponent from '../../../../src/dashboard/containers/DashboardComponent';
|
||||
import DashboardHeader from '../../../../src/dashboard/containers/DashboardHeader';
|
||||
import DashboardGrid from '../../../../src/dashboard/containers/DashboardGrid';
|
||||
import * as dashboardStateActions from '../../../../src/dashboard/actions/dashboardState';
|
||||
|
||||
import WithDragDropContext from '../helpers/WithDragDropContext';
|
||||
import {
|
||||
dashboardLayout as undoableDashboardLayout,
|
||||
@@ -23,6 +26,19 @@ const dashboardLayout = undoableDashboardLayout.present;
|
||||
const layoutWithTabs = undoableDashboardLayoutWithTabs.present;
|
||||
|
||||
describe('DashboardBuilder', () => {
|
||||
let favStarStub;
|
||||
|
||||
beforeAll(() => {
|
||||
// this is invoked on mount, so we stub it instead of making a request
|
||||
favStarStub = sinon
|
||||
.stub(dashboardStateActions, 'fetchFaveStar')
|
||||
.returns({ type: 'mock-action' });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
favStarStub.restore();
|
||||
});
|
||||
|
||||
const props = {
|
||||
dashboardLayout,
|
||||
deleteTopLevelTabs() {},
|
||||
|
||||
Reference in New Issue
Block a user