mirror of
https://github.com/grafana/grafana.git
synced 2025-09-28 12:53:47 +08:00
![renovate[bot]](/assets/img/avatar_default.png)
* Update dependency prettier to v2.5.1 * prettier fixes * chore(toolkit): bump prettier to 2.5.1 * style(eslint): bump grafana config to 2.5.2 in core and toolkit * style(mssql-datasource): fix no-inferrable-types eslint errors Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com> Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
23 lines
695 B
TypeScript
23 lines
695 B
TypeScript
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);
|
|
});
|
|
});
|