fix(ui): clarify teacher help prompt and fit narrow panels
This commit is contained in:
@@ -1869,7 +1869,7 @@ test('project consultations preserve student drafts and switch between work and
|
||||
await expect(page.getByRole('button', { name: '与朋友聊天' })).toHaveAttribute('aria-pressed', 'true');
|
||||
await expect(page.locator('#coding-consultation-dock')).toHaveCSS('width', '508px');
|
||||
await expect(teacher.locator('form .consultation-hint')).toBeVisible();
|
||||
await expect(teacher.locator('form .consultation-hint')).toHaveText('帮我看看');
|
||||
await expect(teacher.locator('form .consultation-hint')).toHaveText('不知道问什么,你先帮我看看👀');
|
||||
await expect(teacher.getByText('把你的困惑说出来就好')).toHaveCount(0);
|
||||
await expect(teacher.getByText('当前项目',{exact:true})).toHaveCount(0);
|
||||
await expect(teacher.getByRole('button',{name:'解释当前代码',exact:true})).toBeVisible();
|
||||
@@ -1924,7 +1924,7 @@ test('project consultations preserve student drafts and switch between work and
|
||||
expect(request.body).not.toHaveProperty('discussion');
|
||||
}
|
||||
await expect(teacher).toHaveAccessibleName('朋友咨询');
|
||||
expect(consultationRequests[0].body).toMatchObject({intent:'suggestions',text:'帮我看看'});
|
||||
expect(consultationRequests[0].body).toMatchObject({intent:'suggestions',text:'不知道问什么,你先帮我看看👀'});
|
||||
expect(consultationRequests[1].body).toMatchObject({text:'怎样观察别人玩游戏?'});
|
||||
expect(consultationRequests[1].body?.intent).toBeUndefined();
|
||||
await page.screenshot({path:test.info().outputPath('project-teacher-side-chat.png')});
|
||||
|
||||
@@ -29,7 +29,7 @@ test('retry stickers stay readable and preserve drafts in a 319px consultation',
|
||||
const panel = page.getByTestId('teacher-chat-panel');
|
||||
const retry = panel.locator('.consultation-retry');
|
||||
await expect(retry).toBeEnabled();
|
||||
await expect(retry).toHaveText('帮我看看');
|
||||
await expect(retry).toHaveText('不知道问什么,你先帮我看看👀');
|
||||
expect(await retry.evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true);
|
||||
const [panelBounds, retryBounds] = await Promise.all([panel.boundingBox(), retry.boundingBox()]);
|
||||
expect(retryBounds!.x).toBeGreaterThanOrEqual(panelBounds!.x);
|
||||
@@ -41,7 +41,7 @@ test('retry stickers stay readable and preserve drafts in a 319px consultation',
|
||||
await expect(page.getByText('我们可以先从一个小地方开始。')).toBeVisible();
|
||||
await expect(input).toHaveValue('我还有一点自己的想法');
|
||||
expect(await page.evaluate(() => (window as unknown as { __teacherReplyInputs: unknown[] }).__teacherReplyInputs)).toEqual([
|
||||
{ requestId: expect.any(String), text: '帮我看看', intent: 'suggestions', references: [], projectId: 'fixture', sourceConversationId: 'source' },
|
||||
{ requestId: expect.any(String), text: '不知道问什么,你先帮我看看👀', intent: 'suggestions', references: [], projectId: 'fixture', sourceConversationId: 'source' },
|
||||
]);
|
||||
}
|
||||
});
|
||||
@@ -89,7 +89,8 @@ for (const width of [319, 508]) {
|
||||
const send = page.getByRole('button', { name: '提问', exact: true });
|
||||
const sent = () => page.evaluate(() => (window as unknown as { __teacherReplyInputs: unknown[] }).__teacherReplyInputs);
|
||||
await expect(hint).toBeEnabled();
|
||||
await expect(hint).toHaveText('帮我看看');
|
||||
await expect(hint).toHaveText('不知道问什么,你先帮我看看👀');
|
||||
expect(await hint.evaluate(el => el.scrollWidth <= el.clientWidth && el.scrollHeight <= el.clientHeight)).toBe(true);
|
||||
await expect(hint).toHaveCSS('background-color', 'rgb(255, 242, 201)');
|
||||
const initialSend = (await send.boundingBox())!;
|
||||
const hintBounds = (await hint.boundingBox())!;
|
||||
@@ -109,9 +110,9 @@ for (const width of [319, 508]) {
|
||||
expect(await sent()).toEqual([]);
|
||||
await hint.click();
|
||||
await expect(page.getByText('我们可以先从一个小地方开始。')).toBeVisible();
|
||||
expect(await sent()).toEqual([{ requestId: expect.any(String), text: '帮我看看', intent: 'suggestions', references: [], projectId: 'fixture', sourceConversationId: 'source' }]);
|
||||
expect(await sent()).toEqual([{ requestId: expect.any(String), text: '不知道问什么,你先帮我看看👀', intent: 'suggestions', references: [], projectId: 'fixture', sourceConversationId: 'source' }]);
|
||||
await expect(page.getByRole('button', { name: '我也说不清,你带我看看', exact: true })).toHaveCount(0);
|
||||
await expect(page.locator('.consultation-messages').getByRole('button', { name: '帮我看看', exact: true })).toHaveCount(0);
|
||||
await expect(page.locator('.consultation-messages').getByRole('button', { name: '不知道问什么,你先帮我看看👀', exact: true })).toHaveCount(0);
|
||||
const card = page.getByRole('button', { name: '可以从哪个小地方开始?' });
|
||||
await expect(card).toBeVisible();
|
||||
await input.fill('留着我自己的草稿');
|
||||
|
||||
Reference in New Issue
Block a user