Dashboard: replace datasource name with a reference object (#33817)

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Elfo404 <me@giordanoricci.com>
This commit is contained in:
Ryan McKinley
2021-10-29 10:57:24 -07:00
committed by GitHub
parent 61fbdb60ff
commit 7319efe077
78 changed files with 759 additions and 320 deletions

View File

@@ -108,6 +108,7 @@ function describeQueryRunnerScenario(
const datasource: any = {
name: 'TestDB',
uid: 'TestDB-uid',
interval: ctx.dsInterval,
query: (options: grafanaData.DataQueryRequest) => {
ctx.queryCalledWith = options;
@@ -156,8 +157,8 @@ describe('PanelQueryRunner', () => {
expect(ctx.queryCalledWith?.requestId).toBe('Q100');
});
it('should set datasource name on request', async () => {
expect(ctx.queryCalledWith?.targets[0].datasource).toBe('TestDB');
it('should set datasource uid on request', async () => {
expect(ctx.queryCalledWith?.targets[0].datasource?.uid).toBe('TestDB-uid');
});
it('should pass scopedVars to datasource with interval props', async () => {