@@ -50,7 +50,7 @@ describe("useAIChat", () => {
5050
5151 const { result } = renderHook ( ( ) => useAIChat ( { client, model : "gpt-5-mini" } ) ) ;
5252
53- let sendPromise : Promise < void > | undefined ;
53+ let sendPromise : Promise < boolean > | undefined ;
5454 await act ( async ( ) => {
5555 sendPromise = result . current . sendMessage ( "Hi" ) ;
5656 } ) ;
@@ -71,7 +71,7 @@ describe("useAIChat", () => {
7171
7272 releaseSecondChunk ( ) ;
7373 await act ( async ( ) => {
74- await sendPromise ;
74+ await expect ( sendPromise ) . resolves . toBe ( true ) ;
7575 } ) ;
7676
7777 await waitFor ( ( ) => {
@@ -102,7 +102,7 @@ describe("useAIChat", () => {
102102
103103 const { result } = renderHook ( ( ) => useAIChat ( { client, model : "gpt-5-mini" } ) ) ;
104104
105- let sendPromise : Promise < void > | undefined ;
105+ let sendPromise : Promise < boolean > | undefined ;
106106 await act ( async ( ) => {
107107 sendPromise = result . current . sendMessage ( "Hi" ) ;
108108 } ) ;
@@ -118,7 +118,7 @@ describe("useAIChat", () => {
118118 releaseSecondChunk ( ) ;
119119
120120 await act ( async ( ) => {
121- await sendPromise ;
121+ await expect ( sendPromise ) . resolves . toBe ( false ) ;
122122 } ) ;
123123
124124 await waitFor ( ( ) => {
@@ -145,7 +145,7 @@ describe("useAIChat", () => {
145145 const { result } = renderHook ( ( ) => useAIChat ( { client, model : "gpt-5-mini" } ) ) ;
146146
147147 await act ( async ( ) => {
148- await result . current . sendMessage ( "Hi" ) ;
148+ await expect ( result . current . sendMessage ( "Hi" ) ) . resolves . toBe ( false ) ;
149149 } ) ;
150150
151151 await waitFor ( ( ) => {
@@ -157,7 +157,7 @@ describe("useAIChat", () => {
157157 shouldFail = false ;
158158
159159 await act ( async ( ) => {
160- await result . current . sendMessage ( "Retry" ) ;
160+ await expect ( result . current . sendMessage ( "Retry" ) ) . resolves . toBe ( true ) ;
161161 } ) ;
162162
163163 await waitFor ( ( ) => {
@@ -187,7 +187,7 @@ describe("useAIChat", () => {
187187 const { result } = renderHook ( ( ) => useAIChat ( { client, model : "gpt-5-mini" } ) ) ;
188188
189189 await act ( async ( ) => {
190- await result . current . sendMessage ( " " ) ;
190+ await expect ( result . current . sendMessage ( " " ) ) . resolves . toBe ( false ) ;
191191 } ) ;
192192
193193 expect ( client . chatCompletionStream ) . not . toHaveBeenCalled ( ) ;
@@ -197,7 +197,7 @@ describe("useAIChat", () => {
197197 } ) ;
198198
199199 await act ( async ( ) => {
200- await result . current . sendMessage ( "Second" ) ;
200+ await expect ( result . current . sendMessage ( "Second" ) ) . resolves . toBe ( false ) ;
201201 } ) ;
202202
203203 expect ( client . chatCompletionStream ) . toHaveBeenCalledTimes ( 1 ) ;
0 commit comments