11import  React  from  'react' 
22import  {  cloneDeep  }  from  'lodash' 
3- import  {  AxiosError  }  from  'axios' 
43import  { 
54  rdiPipelineSelector , 
65  setChangedFile , 
@@ -25,7 +24,10 @@ import {
2524  TelemetryEvent , 
2625}  from  'uiSrc/telemetry' 
2726import  {  FileChangeType  }  from  'uiSrc/slices/interfaces' 
28- import  {  addErrorNotification  }  from  'uiSrc/slices/app/notifications' 
27+ import  { 
28+   addErrorNotification , 
29+   IAddInstanceErrorPayload , 
30+ }  from  'uiSrc/slices/app/notifications' 
2931import  Config  from  './Config' 
3032
3133jest . mock ( 'uiSrc/telemetry' ,  ( )  =>  ( { 
@@ -90,7 +92,7 @@ describe('Config', () => {
9092
9193    render ( < Config  /> ) 
9294
93-     expect ( sendPageViewTelemetry ) . toBeCalledWith ( { 
95+     expect ( sendPageViewTelemetry ) . toHaveBeenCalledWith ( { 
9496      name : TelemetryPageView . RDI_CONFIG , 
9597      eventData : { 
9698        rdiInstanceId : 'rdiInstanceId' , 
@@ -215,7 +217,7 @@ describe('Config', () => {
215217            ) , 
216218          } , 
217219        } , 
218-       }  as  AxiosError ) , 
220+       }  as  IAddInstanceErrorPayload ) , 
219221    ] 
220222
221223    expect ( store . getActions ( ) . slice ( 0 ,  expectedActions . length ) ) . toEqual ( 
@@ -248,8 +250,8 @@ describe('Config', () => {
248250    const  {  getByTestId }  =  render ( < Config  /> ) 
249251
250252    // check is btn has loader 
251-     const  child  =  getByTestId ( 'rdi-test-connection-btn' ) . children [ 0 ] . children [ 0 ] 
252-     expect ( child . tagName . toLowerCase ( ) ) . toEqual ( 'svg' ) 
253+     const  child  =  getByTestId ( 'rdi-test-connection-btn' ) 
254+     expect ( child . querySelector ( 'svg' ) ) . toBeTruthy ( ) 
253255  } ) 
254256
255257  it ( 'should render loader on btn' ,  ( )  =>  { 
@@ -263,8 +265,8 @@ describe('Config', () => {
263265    const  {  getByTestId }  =  render ( < Config  /> ) 
264266
265267    // check is btn has loader 
266-     const  child  =  getByTestId ( 'rdi-test-connection-btn' ) . children [ 0 ] . children [ 0 ] 
267-     expect ( child . tagName . toLowerCase ( ) ) . toEqual ( 'svg' ) 
268+     const  child  =  getByTestId ( 'rdi-test-connection-btn' ) 
269+     expect ( child . querySelector ( 'svg' ) ) . toBeTruthy ( ) 
268270  } ) 
269271
270272  it ( 'should send telemetry event when clicking Test Connection button' ,  async  ( )  =>  { 
0 commit comments