diff --git a/src-ui/src/app/components/chat/chat/chat.component.spec.ts b/src-ui/src/app/components/chat/chat/chat.component.spec.ts index 25a119f1a..cd2ace481 100644 --- a/src-ui/src/app/components/chat/chat/chat.component.spec.ts +++ b/src-ui/src/app/components/chat/chat/chat.component.spec.ts @@ -163,9 +163,10 @@ describe('ChatComponent', () => { component.input.set('Hello') component.sendMessage() + mockStream$.next('Partial') mockStream$.error('Error') - expect(component.messages()[1].content).toContain( - '⚠️ Error receiving response.' + expect(component.messages()[1].content).toBe( + 'Partial\n\n⚠️ Error receiving response.' ) expect(component.loading()).toBe(false) }) diff --git a/src-ui/src/app/components/chat/chat/chat.component.ts b/src-ui/src/app/components/chat/chat/chat.component.ts index 0ffcb5d3d..902b18187 100644 --- a/src-ui/src/app/components/chat/chat/chat.component.ts +++ b/src-ui/src/app/components/chat/chat/chat.component.ts @@ -121,6 +121,7 @@ export class ChatComponent implements OnInit { }, error: () => { this.clearSlowResponse() + this.flushTypewriter(assistantMessage) assistantMessage.content += '\n\n⚠️ Error receiving response.' assistantMessage.isStreaming = false this.notifyMessagesChanged()