|
|
|
|
@ -103,7 +103,7 @@ function describeQueryRunnerScenario(description: string, scenarioFn: ScenarioFn |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
ctx.runner = new PanelQueryRunner(panelConfig || defaultPanelConfig); |
|
|
|
|
ctx.runner.getData().subscribe({ |
|
|
|
|
ctx.runner.getData({ withTransforms: true, withFieldConfig: true }).subscribe({ |
|
|
|
|
next: (data: PanelData) => { |
|
|
|
|
ctx.res = data; |
|
|
|
|
ctx.events?.push(data); |
|
|
|
|
@ -201,7 +201,7 @@ describe('PanelQueryRunner', () => { |
|
|
|
|
it('should apply when field override options are set', async () => { |
|
|
|
|
const spy = jest.spyOn(grafanaData, 'applyFieldOverrides'); |
|
|
|
|
|
|
|
|
|
ctx.runner.getData().subscribe({ |
|
|
|
|
ctx.runner.getData({ withTransforms: true, withFieldConfig: true }).subscribe({ |
|
|
|
|
next: (data: PanelData) => { |
|
|
|
|
return data; |
|
|
|
|
}, |
|
|
|
|
@ -232,7 +232,7 @@ describe('PanelQueryRunner', () => { |
|
|
|
|
const spy = jest.spyOn(grafanaData, 'transformDataFrame'); |
|
|
|
|
spy.mockClear(); |
|
|
|
|
|
|
|
|
|
ctx.runner.getData().subscribe({ |
|
|
|
|
ctx.runner.getData({ withTransforms: true, withFieldConfig: true }).subscribe({ |
|
|
|
|
next: (data: PanelData) => { |
|
|
|
|
return data; |
|
|
|
|
}, |
|
|
|
|
@ -254,7 +254,7 @@ describe('PanelQueryRunner', () => { |
|
|
|
|
it('should not apply transformations when transform option is false', async () => { |
|
|
|
|
const spy = jest.spyOn(grafanaData, 'transformDataFrame'); |
|
|
|
|
spy.mockClear(); |
|
|
|
|
ctx.runner.getData({ withTransforms: false }).subscribe({ |
|
|
|
|
ctx.runner.getData({ withTransforms: false, withFieldConfig: true }).subscribe({ |
|
|
|
|
next: (data: PanelData) => { |
|
|
|
|
return data; |
|
|
|
|
}, |
|
|
|
|
@ -266,7 +266,7 @@ describe('PanelQueryRunner', () => { |
|
|
|
|
it('should not apply field config when applyFieldConfig option is false', async () => { |
|
|
|
|
const spy = jest.spyOn(grafanaData, 'applyFieldOverrides'); |
|
|
|
|
spy.mockClear(); |
|
|
|
|
ctx.runner.getData({ withFieldConfig: false }).subscribe({ |
|
|
|
|
ctx.runner.getData({ withFieldConfig: false, withTransforms: true }).subscribe({ |
|
|
|
|
next: (data: PanelData) => { |
|
|
|
|
return data; |
|
|
|
|
}, |
|
|
|
|
|