From 8d69acb9f821b049638460abbe6518fed13f730d Mon Sep 17 00:00:00 2001 From: Matias Chomicki Date: Thu, 11 Aug 2022 18:08:23 +0200 Subject: [PATCH] Chore(loki): remove any from LokiQueryField test (#53548) --- .betterer.results | 4 ---- .../loki/components/LokiQueryField.test.tsx | 13 ++++++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.betterer.results b/.betterer.results index f438532d268..0d0c2935017 100644 --- a/.betterer.results +++ b/.betterer.results @@ -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"], diff --git a/public/app/plugins/datasource/loki/components/LokiQueryField.test.tsx b/public/app/plugins/datasource/loki/components/LokiQueryField.test.tsx index 61abf95b8e1..4a6f2522a24 100644 --- a/public/app/plugins/datasource/loki/components/LokiQueryField.test.tsx +++ b/public/app/plugins/datasource/loki/components/LokiQueryField.test.tsx @@ -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; @@ -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]),