Chore(loki): remove any from LokiQueryField test (#53548)

This commit is contained in:
Matias Chomicki
2022-08-11 18:08:23 +02:00
committed by GitHub
parent df8d1de94f
commit 8d69acb9f8
2 changed files with 8 additions and 9 deletions
-4
View File
@@ -7303,10 +7303,6 @@ exports[`better eslint`] = {
"public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx:5381": [ "public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"] [0, 0, 0, "Unexpected any. Specify a different type.", "0"]
], ],
"public/app/plugins/datasource/loki/components/LokiQueryField.test.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/plugins/datasource/loki/components/LokiQueryField.tsx:5381": [ "public/app/plugins/datasource/loki/components/LokiQueryField.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "1"],
@@ -3,6 +3,10 @@ import React, { ComponentProps } from 'react';
import { dateTime } from '@grafana/data'; import { dateTime } from '@grafana/data';
import { LokiDatasource } from '../datasource';
import LokiLanguageProvider from '../language_provider';
import syntax from '../syntax';
import { LokiQueryField } from './LokiQueryField'; import { LokiQueryField } from './LokiQueryField';
type Props = ComponentProps<typeof LokiQueryField>; type Props = ComponentProps<typeof LokiQueryField>;
@@ -12,12 +16,11 @@ const defaultProps: Props = {
languageProvider: { languageProvider: {
start: () => Promise.resolve(['label1']), start: () => Promise.resolve(['label1']),
fetchLabels: Promise.resolve(['label1']), fetchLabels: Promise.resolve(['label1']),
getSyntax: () => {}, getSyntax: () => syntax,
getLabelKeys: () => ['label1'], getLabelKeys: () => ['label1'],
getLabelValues: () => ['value1'], getLabelValues: () => Promise.resolve(['value1']),
} as any, } as unknown as LokiLanguageProvider,
getInitHints: () => [], } as LokiDatasource,
} as any,
range: { range: {
from: dateTime([2021, 1, 11, 12, 0, 0]), from: dateTime([2021, 1, 11, 12, 0, 0]),
to: dateTime([2021, 1, 11, 18, 0, 0]), to: dateTime([2021, 1, 11, 18, 0, 0]),