fix(chat): reconcile reply recovery with continuous agent conversations
This commit is contained in:
@@ -47,10 +47,10 @@ test('retry stickers stay readable and preserve drafts in a 319px consultation',
|
||||
});
|
||||
|
||||
for (const width of [319, 508]) {
|
||||
test(`quoted replies recover fully and incomplete replies retry without losing the draft at ${width}px`, async ({ page }) => {
|
||||
for (const chat of ['legacy', 'continuous']) test(`quoted ${chat} replies recover fully and incomplete replies retry without losing the draft at ${width}px`, async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1180, height: 800 });
|
||||
const sent = () => page.evaluate(() => (window as unknown as { __teacherReplyInputs: unknown[] }).__teacherReplyInputs);
|
||||
await page.goto(`${url}?kind=recovered&width=${width}`);
|
||||
await page.goto(`${url}?kind=recovered&width=${width}&chat=${chat}`);
|
||||
const panel = page.getByTestId('teacher-chat-panel');
|
||||
const body = page.getByTestId('teacher-reply');
|
||||
await expect(body).toContainText('它早就不是"刚搭好架子"那种阶段了');
|
||||
@@ -61,7 +61,7 @@ for (const width of [319, 508]) {
|
||||
expect(await body.evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true);
|
||||
await panel.screenshot({ path: test.info().outputPath(`recovered-${width}.png`) });
|
||||
|
||||
await page.goto(`${url}?kind=incomplete&width=${width}`);
|
||||
await page.goto(`${url}?kind=incomplete&width=${width}&chat=${chat}`);
|
||||
await expect(page.getByRole('status')).toHaveText('这次回复未能完整显示');
|
||||
await expect(page.getByTestId('teacher-reply')).toHaveCount(0);
|
||||
expect(await sent()).toEqual([]);
|
||||
@@ -76,7 +76,7 @@ for (const width of [319, 508]) {
|
||||
await expect(page.getByText('好,我们就从这一个问题聊起。')).toBeVisible();
|
||||
await expect(input).toHaveValue('我还在写的新想法');
|
||||
expect(await sent()).toEqual([{
|
||||
requestId: expect.any(String), text: '现在项目是什么阶段?',
|
||||
requestId: expect.any(String), text: '现在项目是什么阶段?', ...(chat === 'continuous' ? { projectId: 'fixture' } : {}),
|
||||
sourceConversationId: 'original-source', references: [{ messageId: 'original-message', text: '原来的项目记录', role: 'assistant' }],
|
||||
}]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user