@ -72,7 +72,7 @@ const failDataSourceTest = async (error: object) => {
} ;
} ;
const dispatchedActions = await thunkTester ( state )
const dispatchedActions = await thunkTester ( state )
. givenThunk ( testDataSource )
. givenThunk ( testDataSource )
. whenThunkIsDispatched ( 'Azure Monitor' , dependencies ) ;
. whenThunkIsDispatched ( 'Azure Monitor' , DATASOURCES_ROUTES . Edit , dependencies ) ;
return dispatchedActions ;
return dispatchedActions ;
} ;
} ;
@ -234,7 +234,7 @@ describe('testDataSource', () => {
} ;
} ;
const dispatchedActions = await thunkTester ( state )
const dispatchedActions = await thunkTester ( state )
. givenThunk ( testDataSource )
. givenThunk ( testDataSource )
. whenThunkIsDispatched ( 'CloudWatch' , dependencies ) ;
. whenThunkIsDispatched ( 'CloudWatch' , DATASOURCES_ROUTES . Edit , dependencies ) ;
expect ( dispatchedActions ) . toEqual ( [ testDataSourceStarting ( ) , testDataSourceSucceeded ( state . testingStatus ) ] ) ;
expect ( dispatchedActions ) . toEqual ( [ testDataSourceStarting ( ) , testDataSourceSucceeded ( state . testingStatus ) ] ) ;
expect ( trackDataSourceTested ) . toHaveBeenCalledWith ( {
expect ( trackDataSourceTested ) . toHaveBeenCalledWith ( {
@ -242,6 +242,7 @@ describe('testDataSource', () => {
datasource_uid : 'CW1234' ,
datasource_uid : 'CW1234' ,
grafana_version : '1.0' ,
grafana_version : '1.0' ,
success : true ,
success : true ,
editLink : '/datasources/edit/CloudWatch' ,
} ) ;
} ) ;
} ) ;
} ) ;
@ -270,7 +271,7 @@ describe('testDataSource', () => {
} ;
} ;
const dispatchedActions = await thunkTester ( state )
const dispatchedActions = await thunkTester ( state )
. givenThunk ( testDataSource )
. givenThunk ( testDataSource )
. whenThunkIsDispatched ( 'Azure Monitor' , dependencies ) ;
. whenThunkIsDispatched ( 'Azure Monitor' , DATASOURCES_ROUTES . Edit , dependencies ) ;
expect ( dispatchedActions ) . toEqual ( [ testDataSourceStarting ( ) , testDataSourceFailed ( result ) ] ) ;
expect ( dispatchedActions ) . toEqual ( [ testDataSourceStarting ( ) , testDataSourceFailed ( result ) ] ) ;
expect ( trackDataSourceTested ) . toHaveBeenCalledWith ( {
expect ( trackDataSourceTested ) . toHaveBeenCalledWith ( {
@ -278,6 +279,7 @@ describe('testDataSource', () => {
datasource_uid : 'azM0nit0R' ,
datasource_uid : 'azM0nit0R' ,
grafana_version : '1.0' ,
grafana_version : '1.0' ,
success : false ,
success : false ,
editLink : '/datasources/edit/Azure Monitor' ,
} ) ;
} ) ;
} ) ;
} ) ;