Skip to content

Commit b5491be

Browse files
committed
update tests
1 parent 17190b8 commit b5491be

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/ConfigEditor.test.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import React from 'react';
22
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
33
import userEvent from '@testing-library/user-event';
44
import { 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

79
jest.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

3335
describe('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

Comments
 (0)