File tree Expand file tree Collapse file tree
apps/sim/lib/sim-search/live Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,22 @@ describe('native search network boundary', () => {
7474 )
7575 expect ( inputValidationMockFns . mockSecureFetchWithValidation ) . not . toHaveBeenCalled ( )
7676 } )
77+ it ( 'keeps the HTTP status of a provider failure so callers can tell a missing item apart' , async ( ) => {
78+ const client = createNativeClient ( {
79+ origin : 'https://api.atlassian.com' ,
80+ accessToken : 'private' ,
81+ signal : new AbortController ( ) . signal ,
82+ } )
83+ for ( const status of [ 404 , 500 ] ) {
84+ inputValidationMockFns . mockSecureFetchWithValidation . mockResolvedValueOnce (
85+ new Response ( 'missing' , { status } )
86+ )
87+ await expect ( client . json ( '/ex/confluence/cloud/wiki/api/v2/pages/1' ) ) . rejects . toMatchObject ( {
88+ status : 'unavailable' ,
89+ httpStatus : status ,
90+ } )
91+ }
92+ } )
7793 it ( 'reports Retry-After without exposing the provider response body' , async ( ) => {
7894 inputValidationMockFns . mockSecureFetchWithValidation . mockResolvedValue (
7995 new Response ( 'sensitive diagnostic' , { status : 429 , headers : { 'Retry-After' : '45' } } )
You can’t perform that action at this time.
0 commit comments