@@ -340,7 +340,8 @@ describe('QuickBooks tool boundaries', () => {
340340 CompanyInfo : { Id : '123456789' , CompanyName : 'Sanitized Company' } ,
341341 time : 'test-time' ,
342342 } )
343- )
343+ ) ,
344+ authParams
344345 )
345346 expect ( result . output ) . toEqual ( {
346347 company : { Id : '123456789' , CompanyName : 'Sanitized Company' } ,
@@ -351,11 +352,25 @@ describe('QuickBooks tool boundaries', () => {
351352 it ( 'rejects an empty CompanyInfo wrapper' , async ( ) => {
352353 await expect (
353354 quickbooksGetCompanyInfoTool . transformResponse ! (
354- new Response ( JSON . stringify ( { time : 'test-time' } ) )
355+ new Response ( JSON . stringify ( { time : 'test-time' } ) ) ,
356+ authParams
355357 )
356358 ) . rejects . toThrow ( 'missing CompanyInfo' )
357359 } )
358360
361+ it ( 'rejects CompanyInfo for a different realm' , async ( ) => {
362+ await expect (
363+ quickbooksGetCompanyInfoTool . transformResponse ! (
364+ new Response (
365+ JSON . stringify ( {
366+ CompanyInfo : { Id : '999' , CompanyName : 'Different Sanitized Company' } ,
367+ } )
368+ ) ,
369+ authParams
370+ )
371+ ) . rejects . toThrow ( 'different company' )
372+ } )
373+
359374 it ( 'recognizes a QuickBooks Fault in an HTTP 200 CompanyInfo response' , async ( ) => {
360375 await expect (
361376 quickbooksGetCompanyInfoTool . transformResponse ! (
@@ -372,7 +387,8 @@ describe('QuickBooks tool boundaries', () => {
372387 } ,
373388 } ) ,
374389 { status : 200 }
375- )
390+ ) ,
391+ authParams
376392 )
377393 ) . rejects . toThrow (
378394 'QuickBooks request failed with HTTP 200. 3200: Authentication failed: Sanitized fault detail'
0 commit comments