Loki: Fix types in querybuilder state test (#53223)

* Chore: add missing refId property to LokiQuery type

* Chore: fix types in Loki querybuilder state test

* Chore: remove unnecessary added property to LokiQuery
This commit is contained in:
Matias Chomicki 2022-08-03 15:59:33 +02:00 committed by GitHub
parent 3877964470
commit 97ce40577b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -7536,10 +7536,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"]
],
"public/app/plugins/datasource/loki/querybuilder/state.test.ts: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/querybuilder/state.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"]
],

View File

@ -4,7 +4,7 @@ import { changeEditorMode, getQueryWithDefaults } from './state';
describe('getQueryWithDefaults(', () => {
it('should set defaults', () => {
expect(getQueryWithDefaults({ refId: 'A' } as any)).toEqual({
expect(getQueryWithDefaults({ refId: 'A', expr: '' })).toEqual({
editorMode: 'builder',
expr: '',
queryType: 'range',
@ -17,6 +17,6 @@ describe('getQueryWithDefaults(', () => {
expect(query.editorMode).toBe(QueryEditorMode.Code);
});
expect(getQueryWithDefaults({ refId: 'A' } as any).editorMode).toEqual(QueryEditorMode.Code);
expect(getQueryWithDefaults({ refId: 'A', expr: '' }).editorMode).toEqual(QueryEditorMode.Code);
});
});