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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -7303,10 +7303,6 @@ exports[`better eslint`] = {
"public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx:5381": [
[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": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],

View File

@ -3,6 +3,10 @@ import React, { ComponentProps } from 'react';
import { dateTime } from '@grafana/data';
import { LokiDatasource } from '../datasource';
import LokiLanguageProvider from '../language_provider';
import syntax from '../syntax';
import { LokiQueryField } from './LokiQueryField';
type Props = ComponentProps<typeof LokiQueryField>;
@ -12,12 +16,11 @@ const defaultProps: Props = {
languageProvider: {
start: () => Promise.resolve(['label1']),
fetchLabels: Promise.resolve(['label1']),
getSyntax: () => {},
getSyntax: () => syntax,
getLabelKeys: () => ['label1'],
getLabelValues: () => ['value1'],
} as any,
getInitHints: () => [],
} as any,
getLabelValues: () => Promise.resolve(['value1']),
} as unknown as LokiLanguageProvider,
} as LokiDatasource,
range: {
from: dateTime([2021, 1, 11, 12, 0, 0]),
to: dateTime([2021, 1, 11, 18, 0, 0]),