forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
697 B
22 lines
697 B
import { isSharedDashboardQuery } from './runSharedRequest';
|
|
import { DataSourceApi } from '@grafana/data';
|
|
|
|
describe('SharedQueryRunner', () => {
|
|
it('should identify shared queries', () => {
|
|
expect(isSharedDashboardQuery('-- Dashboard --')).toBe(true);
|
|
|
|
expect(isSharedDashboardQuery('')).toBe(false);
|
|
expect(isSharedDashboardQuery((undefined as unknown) as null)).toBe(false);
|
|
expect(isSharedDashboardQuery(null)).toBe(false);
|
|
|
|
const ds = {
|
|
meta: {
|
|
name: '-- Dashboard --',
|
|
},
|
|
} as DataSourceApi;
|
|
expect(isSharedDashboardQuery(ds)).toBe(true);
|
|
|
|
ds.meta!.name = 'something else';
|
|
expect(isSharedDashboardQuery(ds)).toBe(false);
|
|
});
|
|
});
|
|
|