@@ -2,7 +2,9 @@ import React from 'react';
22import { render , screen , fireEvent , waitFor } from '@testing-library/react' ;
33import userEvent from '@testing-library/user-event' ;
44import { ConfigEditor } from './ConfigEditor' ;
5- import { GoogleAuthType } from '@grafana/google-sdk' ;
5+ import { DataSourceSettings } from '@grafana/data' ;
6+ import { GoogleSheetsSecureJSONData } from '../types' ;
7+ import { GoogleAuthType , DataSourceOptions } from '@grafana/google-sdk' ;
68
79jest . mock ( '@grafana/plugin-ui' , ( ) => ( {
810 DataSourceDescription : ( ) => < div data-testid = "data-source-description" /> ,
@@ -19,15 +21,15 @@ jest.mock('@grafana/runtime', () => ({
1921 } ) ,
2022} ) ) ;
2123
22- const dataSourceSettings = {
24+ const dataSourceSettings : Partial < DataSourceSettings < DataSourceOptions , GoogleSheetsSecureJSONData > > = {
2325 jsonData : {
2426 authenticationType : GoogleAuthType . JWT ,
2527 } ,
2628 secureJsonFields : {
2729 jwt : true ,
2830 } ,
2931 uid : 'test-uid' ,
30- } as any ;
32+ } ;
3133
3234
3335describe ( 'ConfigEditor' , ( ) => {
@@ -102,7 +104,7 @@ describe('ConfigEditor', () => {
102104 render (
103105 < ConfigEditor
104106 onOptionsChange = { onOptionsChange }
105- options = { dataSourceSettings }
107+ options = { dataSourceSettings as DataSourceSettings < DataSourceOptions , GoogleSheetsSecureJSONData > }
106108 />
107109 ) ;
108110
0 commit comments