Skip to content

Commit e2833f9

Browse files
committed
test(chatbot): draw the restored store messages through the runtime seam
Claude-Session: https://claude.ai/code/session_01Utp6CY3qzEGtLEnwjFyRXG Co-authored-by: Claude <noreply@anthropic.com>
1 parent 039bbc3 commit e2833f9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎ui/packages/plugin-chatbot/src/__tests__/useObjectChat.recordCitationsReload-37487.test.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
2929
import { cleanup, render, renderHook, screen } from '@testing-library/react';
3030
import { RECORD_CITATIONS_PART_TYPE } from '@objectstack/spec/ai';
3131
import { ChatbotEnhanced } from '../ChatbotEnhanced';
32+
import { toRuntimeMessages } from '../chatMessageAdapter';
3233
import { STORED_ANSWER_DATA_PARTS, uiMessageToChatMessage } from '../mapMessages';
3334
import { useObjectChat, type UseObjectChatOptions } from '../useObjectChat';
3435

@@ -92,15 +93,15 @@ describe('restored citations survive the API-mode store (objectstack#37487)', ()
9293
const messages = restore(CITATIONS);
9394
expect(messages[1].content).toBe(TEXT);
9495
expect(messages[1].recordCitations).toEqual(LIVE.recordCitations);
95-
render(<ChatbotEnhanced messages={messages} />);
96+
render(<ChatbotEnhanced messages={toRuntimeMessages(messages)} />);
9697
expect(chipQuotes()).toEqual(live);
9798
});
9899

99100
it('CONTROL: a list the contract refuses draws nothing', () => {
100101
const messages = restore([{ ...CITATIONS[0], section: 'scope' }]);
101102
expect(messages[1].content).toBe(TEXT);
102103
expect(messages[1].recordCitations).toBeUndefined();
103-
render(<ChatbotEnhanced messages={messages} />);
104+
render(<ChatbotEnhanced messages={toRuntimeMessages(messages)} />);
104105
expect(chipQuotes()).toEqual([]);
105106
});
106107
});

0 commit comments

Comments
 (0)