@@ -489,9 +489,11 @@ describe('NetSuite operation contracts', () => {
489489 const entry = SOURCE_MATRIX [ apiIndex ]
490490 apiIndex += 1
491491 const headers =
492- entry . successStatus === 202
493- ? { Location : `${ ORIGIN } /services/rest/async/v1/job/job-${ apiIndex } ` }
494- : undefined
492+ entry . id === 'netsuite_update_record'
493+ ? { Location : `${ ORIGIN } /services/rest/record/v1/customer/7` }
494+ : entry . successStatus === 202
495+ ? { Location : `${ ORIGIN } /services/rest/async/v1/job/job-${ apiIndex } ` }
496+ : undefined
495497 return entry . successStatus === 204 || entry . successStatus === 202
496498 ? new Response ( null , { status : entry . successStatus , headers } )
497499 : new Response ( JSON . stringify ( { operation : entry . id } ) , {
@@ -506,6 +508,11 @@ describe('NetSuite operation contracts', () => {
506508 expect ( result . success , entry . id ) . toBe ( true )
507509 expect ( result . output ?. status , entry . id ) . toBe ( entry . successStatus )
508510 if ( entry . successStatus === 204 ) expect ( result . output ?. data , entry . id ) . toBeNull ( )
511+ if ( entry . id === 'netsuite_update_record' ) {
512+ expect ( result . output ?. location , entry . id ) . toBe (
513+ `${ ORIGIN } /services/rest/record/v1/customer/7`
514+ )
515+ }
509516 if ( entry . successStatus === 202 ) {
510517 expect ( result . output ?. data , entry . id ) . toBeNull ( )
511518 expect ( result . output ?. location , entry . id ) . toContain ( '/services/rest/async/v1/job/' )
@@ -563,7 +570,11 @@ describe('NetSuite operation contracts', () => {
563570
564571 for ( const tool of NETSUITE_TOOLS ) {
565572 const expected = [ 'status' , 'data' ]
566- if ( tool . id === 'netsuite_create_record' || batchToolIds . has ( tool . id ) ) {
573+ if (
574+ tool . id === 'netsuite_create_record' ||
575+ tool . id === 'netsuite_update_record' ||
576+ batchToolIds . has ( tool . id )
577+ ) {
567578 expected . push ( 'location' )
568579 }
569580 if ( batchToolIds . has ( tool . id ) ) expected . push ( 'jobId' )
0 commit comments