|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import { thunkTester } from '../../../../../../test/core/thunk/thunkTester'; |
|
|
|
import { thunkTester } from '../../../../../../test/core/thunk/thunkTester'; |
|
|
|
import { closeEditor, initialState, PanelEditorState } from './reducers'; |
|
|
|
import { closeEditor, initialState, PanelEditorState } from './reducers'; |
|
|
|
import { exitPanelEditor, initPanelEditor, skipPanelUpdate } from './actions'; |
|
|
|
import { exitPanelEditor, initPanelEditor, skipPanelUpdate } from './actions'; |
|
|
|
import { cleanUpPanelState, panelModelAndPluginReady } from 'app/features/panel/state/reducers'; |
|
|
|
import { panelModelAndPluginReady, removePanel } from 'app/features/panel/state/reducers'; |
|
|
|
import { DashboardModel, PanelModel } from '../../../state'; |
|
|
|
import { DashboardModel, PanelModel } from '../../../state'; |
|
|
|
import { getPanelPlugin } from 'app/features/plugins/__mocks__/pluginMocks'; |
|
|
|
import { getPanelPlugin } from 'app/features/plugins/__mocks__/pluginMocks'; |
|
|
|
|
|
|
|
|
|
|
|
@ -48,6 +48,7 @@ describe('panelEditor actions', () => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const dispatchedActions = await thunkTester({ |
|
|
|
const dispatchedActions = await thunkTester({ |
|
|
|
|
|
|
|
panels: {}, |
|
|
|
panelEditor: state, |
|
|
|
panelEditor: state, |
|
|
|
dashboard: { |
|
|
|
dashboard: { |
|
|
|
getModel: () => dashboard, |
|
|
|
getModel: () => dashboard, |
|
|
|
@ -57,7 +58,7 @@ describe('panelEditor actions', () => { |
|
|
|
.whenThunkIsDispatched(); |
|
|
|
.whenThunkIsDispatched(); |
|
|
|
|
|
|
|
|
|
|
|
expect(dispatchedActions.length).toBe(2); |
|
|
|
expect(dispatchedActions.length).toBe(2); |
|
|
|
expect(dispatchedActions[0].type).toBe(cleanUpPanelState.type); |
|
|
|
expect(dispatchedActions[0].type).toBe(removePanel.type); |
|
|
|
expect(dispatchedActions[1].type).toBe(closeEditor.type); |
|
|
|
expect(dispatchedActions[1].type).toBe(closeEditor.type); |
|
|
|
expect(sourcePanel.getOptions()).toEqual({ prop: true }); |
|
|
|
expect(sourcePanel.getOptions()).toEqual({ prop: true }); |
|
|
|
expect(sourcePanel.id).toEqual(12); |
|
|
|
expect(sourcePanel.id).toEqual(12); |
|
|
|
@ -84,6 +85,7 @@ describe('panelEditor actions', () => { |
|
|
|
|
|
|
|
|
|
|
|
const dispatchedActions = await thunkTester({ |
|
|
|
const dispatchedActions = await thunkTester({ |
|
|
|
panelEditor: state, |
|
|
|
panelEditor: state, |
|
|
|
|
|
|
|
panels: {}, |
|
|
|
dashboard: { |
|
|
|
dashboard: { |
|
|
|
getModel: () => dashboard, |
|
|
|
getModel: () => dashboard, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -119,6 +121,7 @@ describe('panelEditor actions', () => { |
|
|
|
|
|
|
|
|
|
|
|
const dispatchedActions = await thunkTester({ |
|
|
|
const dispatchedActions = await thunkTester({ |
|
|
|
panelEditor: state, |
|
|
|
panelEditor: state, |
|
|
|
|
|
|
|
panels: {}, |
|
|
|
dashboard: { |
|
|
|
dashboard: { |
|
|
|
getModel: () => dashboard, |
|
|
|
getModel: () => dashboard, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|