refactor(teacher): retire discussion components and keep text replies
This commit is contained in:
@@ -1816,6 +1816,7 @@ test('project consultations preserve student drafts and switch between work and
|
||||
await teacher.getByRole('textbox',{name:'向智能体提问'}).fill('还没说完的困惑');
|
||||
await teacher.getByRole('button',{name:'帮我看看',exact:true}).click();
|
||||
await expect(teacher.getByText('我们可以从你最近试过的地方聊起。')).toBeVisible();
|
||||
await expect(teacher.getByTestId('teacher-discussion')).toHaveCount(0);
|
||||
await expect(teacher.getByRole('textbox',{name:'向智能体提问'})).toHaveValue('还没说完的困惑');
|
||||
expect((await readState(electronApp)).captured.filter(item=>item.path.endsWith('/messages')&&item.method==='POST')).toHaveLength(1);
|
||||
await teacher.getByRole('button',{name:'怎样观察别人玩游戏?',exact:true}).click();
|
||||
@@ -1849,6 +1850,10 @@ test('project consultations preserve student drafts and switch between work and
|
||||
expect(requests.filter(item=>item.path.endsWith('/prompt')&&item.method==='POST')).toHaveLength(0);
|
||||
const consultationRequests=requests.filter(item=>item.path.endsWith('/messages')&&item.method==='POST');
|
||||
expect(consultationRequests).toHaveLength(3);
|
||||
for (const request of consultationRequests) {
|
||||
expect(request.body).not.toHaveProperty('presentation');
|
||||
expect(request.body).not.toHaveProperty('discussion');
|
||||
}
|
||||
expect(requests.find(item => item.path.endsWith('/agent-topics') && item.method === 'POST')?.body?.teacherVersion).toBe(9);
|
||||
await expect(teacher).toHaveAccessibleName('朋友咨询');
|
||||
expect(consultationRequests[0].body).toMatchObject({intent:'suggestions',text:'帮我看看'});
|
||||
|
||||
Reference in New Issue
Block a user