Skip to content

Commit c944258

Browse files
Fix test for renaming chat title with new error message
1 parent 46179e5 commit c944258

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

archive-doc-gen/src/frontend/src/components/ChatHistory/chatHistoryListItem.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,10 @@ describe('ChatHistoryListItemCell', () => {
554554

555555
test('shows error when trying to rename to an existing title', async () => {
556556
const existingTitle = 'Existing Chat Title'
557-
;(historyRename as jest.Mock).mockResolvedValueOnce({
558-
ok: false,
559-
json: async () => ({ message: 'Title already exists' })
560-
})
557+
; (historyRename as jest.Mock).mockResolvedValueOnce({
558+
ok: false,
559+
json: async () => ({ message: 'Title already exists' })
560+
})
561561

562562
renderWithContext(<ChatHistoryListItemCell item={conversation} onSelect={mockOnSelect} />, mockAppState)
563563

@@ -570,12 +570,12 @@ describe('ChatHistoryListItemCell', () => {
570570
})
571571

572572
const inputItem = screen.getByPlaceholderText(conversation.title)
573-
fireEvent.change(inputItem, { target: { value: 'Another Existing Chat' } })
573+
fireEvent.change(inputItem, { target: { value: 'Test Chat' } })
574574

575575
fireEvent.keyDown(inputItem, { key: 'Enter', code: 'Enter', charCode: 13 })
576576

577577
await waitFor(() => {
578-
expect(screen.getByText(/Error: could not rename item/i)).toBeInTheDocument()
578+
expect(screen.getByText(/Error: Enter a new title to proceed./i)).toBeInTheDocument()
579579
})
580580
})
581581

0 commit comments

Comments
 (0)