Scene: Dashboard loader supports transformations & unit tests (#60855)

* Scene: use transformations for panel queries

* refactor: Clean up DashboardLoader class

* test: Add unit tests for creators

* test: Ensure the row herarchy is properly replicated

* test: Ensure the URLSync is initialized

* refactor: Use fixture to create panels
This commit is contained in:
Ivan Ortega Alba
2023-01-04 14:29:22 +01:00
committed by GitHub
parent 6ab6d661e2
commit d0f6a3a4ca
3 changed files with 422 additions and 127 deletions

View File

@@ -5,6 +5,7 @@ import {
defaultVariableModel,
GraphPanel,
Panel,
RowPanel,
VariableModel,
} from '@grafana/schema';
import { GetVariables } from 'app/features/variables/state/selectors';
@@ -29,7 +30,7 @@ export function createDashboardModelFixture(
return new DashboardModel(dashboardJson, meta, getVariablesFromState);
}
export function createPanelJSONFixture(panelInput: Partial<Panel | GraphPanel> = {}): Panel {
export function createPanelJSONFixture(panelInput: Partial<Panel | GraphPanel | RowPanel> = {}): Panel {
return {
fieldConfig: {
defaults: {},