File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -608,7 +608,7 @@ describe('SimStudioClient', () => {
608608 expect ( requestBody ) . not . toHaveProperty ( 'input' ) // Should not wrap in input field
609609 } )
610610
611- it ( 'should handle null input by wrapping in input field ' , async ( ) => {
611+ it ( 'should handle null input as no input (empty body) ' , async ( ) => {
612612 const fetch = await import ( 'node-fetch' )
613613 const mockResponse = {
614614 ok : true ,
@@ -629,8 +629,8 @@ describe('SimStudioClient', () => {
629629 const calls = vi . mocked ( fetch . default ) . mock . calls
630630 const requestBody = JSON . parse ( calls [ 0 ] [ 1 ] ?. body as string )
631631
632- // null wraps in input field
633- expect ( requestBody ) . toHaveProperty ( 'input' , null )
632+ // null treated as "no input" - sends empty body (consistent with Python SDK)
633+ expect ( requestBody ) . toEqual ( { } )
634634 } )
635635 } )
636636} )
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ export class SimStudioClient {
193193 }
194194
195195 let jsonBody : any = { }
196- if ( input !== undefined ) {
196+ if ( input !== undefined && input !== null ) {
197197 if ( typeof input === 'object' && input !== null && ! Array . isArray ( input ) ) {
198198 jsonBody = { ...input }
199199 } else {
You can’t perform that action at this time.
0 commit comments