mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: reduces strict null errors to 824 (#22744)
* Chore: reduces strict null errors with 100+ * Chore: lowers the build error number
This commit is contained in:
@@ -79,6 +79,7 @@ describe('PromExploreQueryEditor', () => {
|
||||
});
|
||||
|
||||
it('should render PromQueryField with ExtraFieldElement', async () => {
|
||||
// @ts-ignore strict null errpr TS2345: Argument of type '() => Promise<void>' is not assignable to parameter of type '() => void | undefined'.
|
||||
await act(async () => {
|
||||
const wrapper = setup(mount);
|
||||
expect(wrapper.find(PromExploreExtraField).length).toBe(1);
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { getValueFromEventItem, promSettingsValidationEvents } from './PromSettings';
|
||||
import { EventsWithValidation } from '@grafana/ui';
|
||||
import { SyntheticEvent } from 'react';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
|
||||
describe('PromSettings', () => {
|
||||
describe('getValueFromEventItem', () => {
|
||||
describe('when called with undefined', () => {
|
||||
it('then it should return empty string', () => {
|
||||
const result = getValueFromEventItem(undefined);
|
||||
const result = getValueFromEventItem(
|
||||
(undefined as unknown) as SyntheticEvent<HTMLInputElement> | SelectableValue<string>
|
||||
);
|
||||
expect(result).toEqual('');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('Prometheus Result Transformer', () => {
|
||||
status: 'success',
|
||||
data: {
|
||||
resultType: '',
|
||||
result: null as DataQueryResponseData[],
|
||||
result: (null as unknown) as DataQueryResponseData[],
|
||||
},
|
||||
};
|
||||
const series = ctx.resultTransformer.transform({ data: response }, {});
|
||||
@@ -28,7 +28,7 @@ describe('Prometheus Result Transformer', () => {
|
||||
status: 'success',
|
||||
data: {
|
||||
resultType: '',
|
||||
result: null as DataQueryResponseData[],
|
||||
result: (null as unknown) as DataQueryResponseData[],
|
||||
},
|
||||
};
|
||||
const table = ctx.resultTransformer.transform({ data: response }, { format: 'table' });
|
||||
|
||||
Reference in New Issue
Block a user