|
|
|
@ -12,6 +12,7 @@ import { |
|
|
|
|
sceneGraph, |
|
|
|
|
GroupByVariable, |
|
|
|
|
AdHocFiltersVariable, |
|
|
|
|
SceneDataTransformer, |
|
|
|
|
} from '@grafana/scenes'; |
|
|
|
|
import { |
|
|
|
|
AdhocVariableKind, |
|
|
|
@ -29,6 +30,7 @@ import { DashboardWithAccessInfo } from 'app/features/dashboard/api/dashboard_ap |
|
|
|
|
import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource'; |
|
|
|
|
|
|
|
|
|
import { DashboardDataLayerSet } from '../scene/DashboardDataLayerSet'; |
|
|
|
|
import { DefaultGridLayoutManager } from '../scene/layout-default/DefaultGridLayoutManager'; |
|
|
|
|
import { DashboardLayoutManager } from '../scene/types'; |
|
|
|
|
import { dashboardSceneGraph } from '../utils/dashboardSceneGraph'; |
|
|
|
|
import { getQueryRunnerFor } from '../utils/utils'; |
|
|
|
@ -208,7 +210,20 @@ describe('transformSaveModelSchemaV2ToScene', () => { |
|
|
|
|
const vizPanel = vizPanels[0]; |
|
|
|
|
validateVizPanel(vizPanel, dash); |
|
|
|
|
|
|
|
|
|
// FIXME: Tests for layout
|
|
|
|
|
// Layout
|
|
|
|
|
const layout = scene.state.body as DefaultGridLayoutManager; |
|
|
|
|
expect(layout.state.grid.state.children.length).toBe(1); |
|
|
|
|
expect(layout.state.grid.state.children[0].state.key).toBe(`grid-item-${Object.keys(dash.elements)[0]}`); |
|
|
|
|
const gridLayoutItemSpec = dash.layout.spec.items[0].spec; |
|
|
|
|
expect(layout.state.grid.state.children[0].state.width).toBe(gridLayoutItemSpec.width); |
|
|
|
|
expect(layout.state.grid.state.children[0].state.height).toBe(gridLayoutItemSpec.height); |
|
|
|
|
expect(layout.state.grid.state.children[0].state.x).toBe(gridLayoutItemSpec.x); |
|
|
|
|
expect(layout.state.grid.state.children[0].state.y).toBe(gridLayoutItemSpec.y); |
|
|
|
|
|
|
|
|
|
// Transformations
|
|
|
|
|
expect((vizPanel.state.$data as SceneDataTransformer)?.state.transformations[0]).toEqual( |
|
|
|
|
dash.elements['test-panel-uid'].spec.data.spec.transformations[0].spec |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should set panel ds if it is mixed DS', () => { |
|
|
|
|