|
|
|
@ -1,5 +1,9 @@ |
|
|
|
|
import { renderHook } from '@testing-library/react-hooks'; |
|
|
|
|
import { MockedObjectDeep } from 'ts-jest/dist/utils/testing'; |
|
|
|
|
|
|
|
|
|
import createMockDatasource from '../../__mocks__/datasource'; |
|
|
|
|
import Datasource from '../../datasource'; |
|
|
|
|
import { AzureMetricQuery, AzureMonitorOption, AzureMonitorQuery, AzureQueryType } from '../../types'; |
|
|
|
|
import { |
|
|
|
|
DataHook, |
|
|
|
|
updateSubscriptions, |
|
|
|
@ -11,10 +15,6 @@ import { |
|
|
|
|
useResourceTypes, |
|
|
|
|
useSubscriptions, |
|
|
|
|
} from './dataHooks'; |
|
|
|
|
import { AzureMetricQuery, AzureMonitorOption, AzureMonitorQuery, AzureQueryType } from '../../types'; |
|
|
|
|
import createMockDatasource from '../../__mocks__/datasource'; |
|
|
|
|
import { MockedObjectDeep } from 'ts-jest/dist/utils/testing'; |
|
|
|
|
import Datasource from '../../datasource'; |
|
|
|
|
|
|
|
|
|
interface WaitableMock extends jest.Mock<any, any> { |
|
|
|
|
waitToBeCalled(): Promise<unknown>; |
|
|
|
@ -363,6 +363,11 @@ describe('AzureMonitor: updateSubscriptions', () => { |
|
|
|
|
query: { ...bareQuery, subscription: 'foo' }, |
|
|
|
|
subscriptionOptions: [{ label: 'foo', value: 'foo' }], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
description: 'should not update with a template variable', |
|
|
|
|
query: { ...bareQuery, subscription: '$foo' }, |
|
|
|
|
subscriptionOptions: [], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
description: 'should update with the first subscription', |
|
|
|
|
query: { ...bareQuery }, |
|
|
|
|