File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
webview-ui/src/components/modes/__tests__ Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -223,12 +223,13 @@ describe("PromptsView", () => {
223223 const changeEvent = new Event ( "change" , { bubbles : true } )
224224 fireEvent ( textarea , changeEvent )
225225
226- // The component calls setCustomInstructions with value || undefined
227- // Since empty string is falsy, it should be undefined
228- expect ( setCustomInstructions ) . toHaveBeenCalledWith ( undefined )
226+ // The component calls setCustomInstructions with value ?? undefined
227+ // With nullish coalescing, empty string is preserved (not treated as nullish)
228+ expect ( setCustomInstructions ) . toHaveBeenCalledWith ( "" )
229+ // The postMessage call will have multiple calls, we need to check the right one
229230 expect ( vscode . postMessage ) . toHaveBeenCalledWith ( {
230231 type : "customInstructions" ,
231- text : undefined ,
232+ text : "" , // empty string is now preserved with ?? operator
232233 } )
233234 } )
234235} )
You can’t perform that action at this time.
0 commit comments