Merge welcome dismissal while preserving continuous conversation entry
This commit is contained in:
@@ -2174,6 +2174,41 @@ test('settled prompt releases the composer without a client receipt and keeps th
|
||||
} finally { await releaseSnapshot(electronApp); }
|
||||
});
|
||||
|
||||
test('teacher avatar consumes the welcome bubble through close, reopen and reload without a model request', async ({ launchElectronApp }) => {
|
||||
const electronApp = await launchElectronApp({ skipSetup: true });
|
||||
let page = await getStableWindow(electronApp);
|
||||
const connection = await page.evaluate(async () => ({ token: await window.electron.ipcRenderer.invoke('hostapi:token') as string, baseUrl: await window.electron.ipcRenderer.invoke('hostapi:base-url') as string }));
|
||||
await installCodingFirstChatHost(electronApp, connection, true);
|
||||
await settleSnapshot(electronApp);
|
||||
await disableCodingEventSource(page);
|
||||
try {
|
||||
await page.reload(); page = await getStableWindow(electronApp);
|
||||
await page.getByTestId('ai-module-option-programming').click();
|
||||
await page.evaluate(() => { window.location.hash = '/chat'; });
|
||||
const teacherButton = page.getByRole('button', { name: '与代码智能体聊天', exact: true });
|
||||
const invitation = page.getByTestId('teacher-invitation');
|
||||
const teacher = page.getByTestId('teacher-chat-panel');
|
||||
await expect(invitation).toHaveAttribute('data-bubble-kind', 'welcome');
|
||||
await teacherButton.click();
|
||||
await expect(teacher).toBeVisible();
|
||||
await expect(teacher.getByText('一起理解代码', { exact: true })).toBeVisible();
|
||||
await expect(invitation).toHaveCount(0);
|
||||
await page.screenshot({ path: test.info().outputPath('teacher-avatar-consumed-welcome.png') });
|
||||
await teacherButton.click();
|
||||
await expect(teacher).toHaveCount(0);
|
||||
await expect(invitation).toHaveCount(0);
|
||||
await teacherButton.click();
|
||||
await expect(teacher).toBeVisible();
|
||||
await expect(invitation).toHaveCount(0);
|
||||
await teacherButton.click();
|
||||
await expect(teacher).toHaveCount(0);
|
||||
await page.reload();
|
||||
await expect(teacherButton).toBeVisible();
|
||||
await expect(invitation).toHaveCount(0);
|
||||
expect((await readState(electronApp)).captured.filter(item => /\/(agent-topics|messages|teacher-check-in|prompt)$/.test(item.path) && item.method === 'POST')).toHaveLength(0);
|
||||
} finally { await releaseSnapshot(electronApp); }
|
||||
});
|
||||
|
||||
test('teacher stays in the top-right header without legacy check-ins or taking over the student draft', async ({ launchElectronApp }) => {
|
||||
const electronApp = await launchElectronApp({ skipSetup: true });
|
||||
let page = await getStableWindow(electronApp);
|
||||
|
||||
Reference in New Issue
Block a user