fix: render consultation replies and typed tool activity
This commit is contained in:
1 parent
a628860144
commit
97837cef90
19 files changed
+432
-35
No files matched your search
@@ -304,6 +304,22 @@ describe('applying completed teacher replies', () => {
|
||||
expect(turn.discussionSnapshot).toBeUndefined();
|
||||
});
|
||||
|
||||
it('retains the original failed answer for inspection without changing the discussion', () => {
|
||||
const owner = topic(flow, 'paused');
|
||||
const before = structuredClone(owner.discussion);
|
||||
const turn = request(owner);
|
||||
const raw = '{"reply":"收到,先看看项目。","tool":{"kind":"flow",';
|
||||
applyDiscussionReply(owner, turn, raw);
|
||||
expect(turn.response).toBe('收到,先看看项目。');
|
||||
expect(turn.unparsedResponse).toBe(raw);
|
||||
expect(owner.discussion).toEqual(before);
|
||||
const plainTurn = request(owner);
|
||||
applyDiscussionReply(owner, plainTurn, '[项目说明](https://example.com)');
|
||||
expect(plainTurn.discussionError).toBeUndefined();
|
||||
expect(plainTurn.unparsedResponse).toBeUndefined();
|
||||
expect(owner.discussion).toEqual(before);
|
||||
});
|
||||
|
||||
it('keeps legacy text as a normal answer without creating a component', () => {
|
||||
const owner = topic();
|
||||
const turn = request(owner);
|
||||
|
||||
Reference in new issue
Block a user