mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: reduces circular dependencies for variables/utils.ts (#44087)
* Chore: move constants to own file * Chore: moves safe* functions to grafana/data * Chore: moves safe* functions to grafana/data * Chore: adds VariableQueryEditorProps and deprecates VariableQueryProps * Chore: remove getDefaultVariableAdapters function * Chore: moves transaction status to types * Chore: fix tests that do not initialise TemplateSrv * Chore: change space when stringifying * Chore: revert safe* func move * Chore: remove circular dependency in Explore utils
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import React from 'react';
|
||||
import { DebugSection } from './DebugSection';
|
||||
import { mount } from 'enzyme';
|
||||
import { getLinkSrv, LinkService, LinkSrv, setLinkSrv } from '../../../../features/panel/panellinks/link_srv';
|
||||
import { dateTime } from '@grafana/data';
|
||||
import { setTemplateSrv } from '@grafana/runtime';
|
||||
|
||||
import { DebugSection } from './DebugSection';
|
||||
import { getLinkSrv, LinkService, LinkSrv, setLinkSrv } from '../../../../features/panel/panellinks/link_srv';
|
||||
|
||||
// We do not need more here and TimeSrv is hard to setup fully.
|
||||
jest.mock('app/features/dashboard/services/TimeSrv', () => ({
|
||||
@@ -25,6 +27,17 @@ describe('DebugSection', () => {
|
||||
setLinkSrv(linkService);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
setTemplateSrv({
|
||||
replace(target, scopedVars, format) {
|
||||
return target ?? '';
|
||||
},
|
||||
getVariables() {
|
||||
return [];
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
setLinkSrv(originalLinkSrv);
|
||||
});
|
||||
@@ -67,6 +80,6 @@ describe('DebugSection', () => {
|
||||
expect(wrapper.find('table').length).toBe(1);
|
||||
// 3 rows + one header
|
||||
expect(wrapper.find('tr').length).toBe(4);
|
||||
expect(wrapper.find('tr').at(1).contains('http://localhost/trace/1234')).toBeTruthy();
|
||||
expect(wrapper.find('tr').at(1).contains('http://localhost/trace/${__value.raw}')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user