fix(core): ai make it real ci timeout (#12954)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Replaced the boolean flag for selecting AI workflow endpoints with a
clear and flexible enum, enhancing clarity and maintainability for
AI-powered features.

* **Tests**
  * Simplified example text in AI action tests to improve consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
This commit is contained in:
Wu Yue
2025-06-28 20:56:12 +08:00
committed by GitHub
parent f88e1dffb6
commit a4680d236d
4 changed files with 25 additions and 28 deletions

View File

@@ -12,10 +12,7 @@ test.describe('AIAction/MakeItReal', () => {
loggedInPage: page,
utils,
}) => {
const { makeItReal } = await utils.editor.askAIWithText(
page,
'AFFiNE is a workspace with fully merged docs'
);
const { makeItReal } = await utils.editor.askAIWithText(page, 'Hello');
const { answer, responses } = await makeItReal();
await expect(answer.locator('iframe')).toBeVisible({ timeout: 30000 });
expect(responses).toEqual(new Set(['insert-below']));
@@ -28,10 +25,7 @@ test.describe('AIAction/MakeItReal', () => {
const { makeItReal } = await utils.editor.askAIWithEdgeless(
page,
async () => {
await utils.editor.createEdgelessText(
page,
'AFFiNE is a workspace with fully merged docs'
);
await utils.editor.createEdgelessText(page, 'Hello');
}
);
const { answer, responses } = await makeItReal();
@@ -46,10 +40,7 @@ test.describe('AIAction/MakeItReal', () => {
const { makeItReal } = await utils.editor.askAIWithEdgeless(
page,
async () => {
await utils.editor.createEdgelessNote(
page,
'AFFiNE is a workspace with fully merged docs'
);
await utils.editor.createEdgelessNote(page, 'Hello');
}
);
const { answer, responses } = await makeItReal();
@@ -77,10 +68,7 @@ test.describe('AIAction/MakeItReal', () => {
loggedInPage: page,
utils,
}) => {
const { makeItReal } = await utils.editor.askAIWithText(
page,
'AFFiNE is a workspace with fully merged docs'
);
const { makeItReal } = await utils.editor.askAIWithText(page, 'Hello');
const { answer } = await makeItReal();
const insert = answer.getByTestId('answer-insert-below');
await insert.click();