mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(core): chat-panel buttons ui (#11942)
Close [AI-7](https://linear.app/affine-design/issue/AI-7). 
This commit is contained in:
30
tests/affine-cloud-copilot/e2e/chat-with/reasoning.spec.ts
Normal file
30
tests/affine-cloud-copilot/e2e/chat-with/reasoning.spec.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { test } from '../base/base-test';
|
||||
|
||||
test.describe('AIChatWith/Reasoning', () => {
|
||||
test.beforeEach(async ({ loggedInPage: page, utils }) => {
|
||||
await utils.testUtils.setupTestEnvironment(page);
|
||||
await utils.chatPanel.openChatPanel(page);
|
||||
});
|
||||
|
||||
test('should support chat with reasoning', async ({
|
||||
loggedInPage: page,
|
||||
utils,
|
||||
}) => {
|
||||
await utils.chatPanel.enableReasoning(page);
|
||||
await utils.chatPanel.makeChat(
|
||||
page,
|
||||
'How do you measure exactly 4 liters of water using a jug that only holds 3 and 5 liters?'
|
||||
);
|
||||
await utils.chatPanel.waitForHistory(page, [
|
||||
{
|
||||
role: 'user',
|
||||
content:
|
||||
'How do you measure exactly 4 liters of water using a jug that only holds 3 and 5 liters?',
|
||||
},
|
||||
{
|
||||
role: 'assistant',
|
||||
status: 'success',
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -305,6 +305,20 @@ export class ChatPanelUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static async enableReasoning(page: Page) {
|
||||
const reasoning = page.getByTestId('chat-reasoning');
|
||||
if ((await reasoning.getAttribute('data-active')) === 'false') {
|
||||
await reasoning.click();
|
||||
}
|
||||
}
|
||||
|
||||
public static async disableReasoning(page: Page) {
|
||||
const reasoning = page.getByTestId('chat-reasoning');
|
||||
if ((await reasoning.getAttribute('data-active')) === 'true') {
|
||||
await reasoning.click();
|
||||
}
|
||||
}
|
||||
|
||||
public static async isNetworkSearchEnabled(page: Page) {
|
||||
const networkSearch = await page.getByTestId('chat-network-search');
|
||||
return (await networkSearch.getAttribute('aria-disabled')) === 'false';
|
||||
|
||||
Reference in New Issue
Block a user