Skip to content

Commit 17190b8

Browse files
committed
update tests
1 parent 222b030 commit 17190b8

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/ConfigEditor.test.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ 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 { DataSourceSettings } from '@grafana/data';
6-
import { GoogleSheetsSecureJSONData } from '../types';
7-
import { GoogleAuthType, DataSourceOptions } from '@grafana/google-sdk';
5+
import { GoogleAuthType } from '@grafana/google-sdk';
86

97
jest.mock('@grafana/plugin-ui', () => ({
108
DataSourceDescription: () => <div data-testid="data-source-description" />,
@@ -21,15 +19,15 @@ jest.mock('@grafana/runtime', () => ({
2119
}),
2220
}));
2321

24-
const dataSourceSettings: DataSourceSettings<DataSourceOptions, GoogleSheetsSecureJSONData> = {
22+
const dataSourceSettings = {
2523
jsonData: {
2624
authenticationType: GoogleAuthType.JWT,
2725
},
2826
secureJsonFields: {
2927
jwt: true,
3028
},
3129
uid: 'test-uid',
32-
} as DataSourceSettings<DataSourceOptions, GoogleSheetsSecureJSONData>;
30+
} as any;
3331

3432

3533
describe('ConfigEditor', () => {
@@ -110,11 +108,11 @@ describe('ConfigEditor', () => {
110108

111109
const selectEl = screen.getByText('Select Spreadsheet ID');
112110
expect(selectEl).toBeInTheDocument();
113-
111+
114112
await userEvent.click(selectEl);
115113
const spreadsheetOption = await screen.findByText('label1', {}, { timeout: 3000 });
116114
await userEvent.click(spreadsheetOption);
117-
115+
118116
await waitFor(() => {
119117
expect(onOptionsChange).toHaveBeenCalledWith(
120118
expect.objectContaining({

0 commit comments

Comments
 (0)