mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: more ts test fixes (#63438)
* replace anys in tests * more test fixes * clean up any's in tests
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
import InfluxQueryModel from '../influx_query_model';
|
||||
|
||||
describe('InfluxQuery', () => {
|
||||
const templateSrv: any = { replace: (val: any) => val };
|
||||
const templateSrv = { replace: (val) => val } as TemplateSrv;
|
||||
|
||||
describe('render series with measurement only', () => {
|
||||
it('should generate correct query', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { size } from 'lodash';
|
||||
import { of } from 'rxjs';
|
||||
import { TemplateSrvStub } from 'test/specs/helpers';
|
||||
|
||||
import { FieldType, MutableDataFrame } from '@grafana/data';
|
||||
import { AnnotationEvent, DataQueryRequest, FieldType, MutableDataFrame } from '@grafana/data';
|
||||
import { FetchResponse } from '@grafana/runtime';
|
||||
import { backendSrv } from 'app/core/services/backend_srv'; // will use the version in __mocks__
|
||||
|
||||
@@ -313,14 +313,14 @@ describe('influxdb response parser', () => {
|
||||
tagsColumn: 'host,path',
|
||||
};
|
||||
|
||||
const queryOptions: any = {
|
||||
const queryOptions = {
|
||||
targets: [annotation],
|
||||
range: {
|
||||
from: '2018-01-01T00:00:00Z',
|
||||
to: '2018-01-02T00:00:00Z',
|
||||
},
|
||||
};
|
||||
let response: any;
|
||||
} as unknown as DataQueryRequest;
|
||||
let response: AnnotationEvent[];
|
||||
|
||||
beforeEach(async () => {
|
||||
fetchMock.mockImplementation(() => {
|
||||
@@ -433,13 +433,13 @@ describe('influxdb response parser', () => {
|
||||
expect(response[0].time).toBe(1645208701000);
|
||||
expect(response[0].title).toBe('Station softwareupdated[447]: Adding client 1');
|
||||
expect(response[0].text).toBe('text 1');
|
||||
expect(response[0].tags[0]).toBe('cbfa07e0e3bb 1');
|
||||
expect(response[0].tags[1]).toBe('/var/log/host/install.log 1');
|
||||
expect(response[0].tags?.[0]).toBe('cbfa07e0e3bb 1');
|
||||
expect(response[0].tags?.[1]).toBe('/var/log/host/install.log 1');
|
||||
expect(response[1].time).toBe(1645208702000);
|
||||
expect(response[1].title).toBe('Station softwareupdated[447]: Adding client 2');
|
||||
expect(response[1].text).toBe('text 2');
|
||||
expect(response[1].tags[0]).toBe('cbfa07e0e3bb 2');
|
||||
expect(response[1].tags[1]).toBe('/var/log/host/install.log 2');
|
||||
expect(response[1].tags?.[0]).toBe('cbfa07e0e3bb 2');
|
||||
expect(response[1].tags?.[1]).toBe('/var/log/host/install.log 2');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user