mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
24 lines
696 B
TypeScript
24 lines
696 B
TypeScript
import { DataSourceApi } from '@grafana/data';
|
|
|
|
import { isSharedDashboardQuery } from './runSharedRequest';
|
|
|
|
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);
|
|
});
|
|
});
|