@@ -74,21 +74,24 @@ describe('HttpLogic', () => {
7474 describe ( 'errorConnectingInterceptor' , ( ) => {
7575 it ( 'handles errors connecting to Enterprise Search' , async ( ) => {
7676 const { responseError } = mockHttp . intercept . mock . calls [ 0 ] [ 0 ] as any ;
77- await responseError ( { response : { url : '/api/app_search/engines' , status : 502 } } ) ;
77+ const httpResponse = { response : { url : '/api/app_search/engines' , status : 502 } } ;
78+ await expect ( responseError ( httpResponse ) ) . rejects . toEqual ( httpResponse ) ;
7879
7980 expect ( HttpLogic . actions . setErrorConnecting ) . toHaveBeenCalled ( ) ;
8081 } ) ;
8182
8283 it ( 'does not handle non-502 Enterprise Search errors' , async ( ) => {
8384 const { responseError } = mockHttp . intercept . mock . calls [ 0 ] [ 0 ] as any ;
84- await responseError ( { response : { url : '/api/workplace_search/overview' , status : 404 } } ) ;
85+ const httpResponse = { response : { url : '/api/workplace_search/overview' , status : 404 } } ;
86+ await expect ( responseError ( httpResponse ) ) . rejects . toEqual ( httpResponse ) ;
8587
8688 expect ( HttpLogic . actions . setErrorConnecting ) . not . toHaveBeenCalled ( ) ;
8789 } ) ;
8890
8991 it ( 'does not handle errors for unrelated calls' , async ( ) => {
9092 const { responseError } = mockHttp . intercept . mock . calls [ 0 ] [ 0 ] as any ;
91- await responseError ( { response : { url : '/api/some_other_plugin/' , status : 502 } } ) ;
93+ const httpResponse = { response : { url : '/api/some_other_plugin/' , status : 502 } } ;
94+ await expect ( responseError ( httpResponse ) ) . rejects . toEqual ( httpResponse ) ;
9295
9396 expect ( HttpLogic . actions . setErrorConnecting ) . not . toHaveBeenCalled ( ) ;
9497 } ) ;
0 commit comments