grafana/public/app/angular/services/annotations_srv.test.ts
Torkel Ödegaard c96c92d712
Angular: Isolate angular more (#41440)
* Getting close

* Restore angular app boot at startup

* Moving angular annotations dependencies to app/angular or old graph

* Remove redundant setLinkSrv call

* Fixing graph test

* Minor refactor based on review feedback

* Create in get function
2021-11-10 11:05:36 +01:00

31 lines
812 B
TypeScript

import { AnnotationsSrv } from './annotations_srv';
describe('AnnotationsSrv', () => {
const annotationsSrv = new AnnotationsSrv();
describe('When translating the query result', () => {
const annotationSource = {
datasource: '-- Grafana --',
enable: true,
hide: false,
limit: 200,
name: 'test',
scope: 'global',
tags: ['test'],
type: 'event',
};
const time = 1507039543000;
const annotations = [{ id: 1, panelId: 1, text: 'text', time: time }];
let translatedAnnotations: any;
beforeEach(() => {
translatedAnnotations = annotationsSrv.translateQueryResult(annotationSource, annotations);
});
it('should set defaults', () => {
expect(translatedAnnotations[0].source).toEqual(annotationSource);
});
});
});