mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Component that can cache and extract variable dependencies * Component that can cache and extract variable dependencies * Updates * Refactoring * Lots of refactoring and iterations of supporting both re-rendering and query re-execution * Updated SceneCanvasText * Updated name of file * Updated * Refactoring a bit * Added back getName * Added comment * minor fix * Minor fix * Merge fixes * Scene variable interpolation progress * Merge fixes * Added all format registeries * Progress on multi value support * Progress on multi value support * Updates * Progress on scoped vars * Fixed circular dependency * Updates * Some review fixes * Updated comment * Added forceRender function * Add back fail on console log * Update public/app/features/scenes/variables/interpolation/sceneInterpolator.test.ts * Moving functions from SceneObjectBase * fixing tests * Fixed e2e Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
25 lines
871 B
TypeScript
25 lines
871 B
TypeScript
import { queryMetricTree } from './metricTree';
|
|
|
|
describe('MetricTree', () => {
|
|
it('queryMetric tree return right tree nodes', () => {
|
|
const nodes = queryMetricTree('*');
|
|
expect(nodes[0].children[0].name).toBe('AA');
|
|
expect(nodes[0].children[1].name).toBe('AB');
|
|
});
|
|
|
|
it('queryMetric tree return right tree nodes', () => {
|
|
const nodes = queryMetricTree('A.AB.ABC.*');
|
|
expect(nodes[0].name).toBe('ABCA');
|
|
});
|
|
|
|
it('queryMetric tree supports glob paths', () => {
|
|
const nodes = queryMetricTree('A.{AB,AC}.*').map((i) => i.name);
|
|
expect(nodes).toEqual(expect.arrayContaining(['ABA', 'ABB', 'ABC', 'ACA', 'ACB', 'ACC']));
|
|
});
|
|
|
|
it('queryMetric tree supports wildcard matching', () => {
|
|
const nodes = queryMetricTree('A.AB.AB*').map((i) => i.name);
|
|
expect(nodes).toEqual(expect.arrayContaining(['ABA', 'ABB', 'ABC']));
|
|
});
|
|
});
|