mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-03-22 23:30:36 +08:00
#### PR Dependency Tree * **PR #14583** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Gemini 3.1 Pro Preview support (text, image, audio) and new GPT‑5 variants as defaults; centralized persistent telemetry state for more reliable client identity. * **UX** * Improved model submenu placement in chat preferences. * More robust mindmap parsing, preview, regeneration and replace behavior. * **Chores** * Bumped AI SDK and related dependencies. * **Tests** * Expanded/updated tests and increased timeouts for flaky flows. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
92 lines
2.9 KiB
TypeScript
92 lines
2.9 KiB
TypeScript
import { expect } from '@playwright/test';
|
|
|
|
import { test } from '../base/base-test';
|
|
|
|
test.describe('AIAction/MakeItReal', () => {
|
|
test.describe.configure({ timeout: 180000 });
|
|
|
|
test.beforeEach(async ({ loggedInPage: page, utils }) => {
|
|
await utils.testUtils.setupTestEnvironment(page);
|
|
await utils.chatPanel.openChatPanel(page);
|
|
});
|
|
|
|
test('should support making the selected content to real', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
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']));
|
|
});
|
|
|
|
test('should support making the selected text block to real in edgeless', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
const { makeItReal } = await utils.editor.askAIWithEdgeless(
|
|
page,
|
|
async () => {
|
|
await utils.editor.createEdgelessText(page, 'Hello');
|
|
}
|
|
);
|
|
const { answer, responses } = await makeItReal();
|
|
await expect(answer.locator('iframe')).toBeVisible({ timeout: 30000 });
|
|
expect(responses).toEqual(new Set(['insert-below']));
|
|
});
|
|
|
|
test('should support making the selected note block to real in edgeless', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
const { makeItReal } = await utils.editor.askAIWithEdgeless(
|
|
page,
|
|
async () => {
|
|
await utils.editor.createEdgelessNote(page, 'Hello');
|
|
}
|
|
);
|
|
const { answer, responses } = await makeItReal();
|
|
await expect(answer.locator('iframe')).toBeVisible({ timeout: 30000 });
|
|
expect(responses).toEqual(new Set(['insert-below']));
|
|
});
|
|
|
|
test('should support making the selected element to real in edgeless', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
const { makeItReal } = await utils.editor.askAIWithEdgeless(
|
|
page,
|
|
async () => {
|
|
await utils.editor.createShape(page, 'HelloWorld');
|
|
}
|
|
);
|
|
|
|
const { answer, responses } = await makeItReal();
|
|
await expect(answer.locator('iframe')).toBeVisible({ timeout: 30000 });
|
|
expect(responses).toEqual(new Set(['insert-below']));
|
|
});
|
|
|
|
test.skip('should show chat history in chat panel', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
const { makeItReal } = await utils.editor.askAIWithText(page, 'Hello');
|
|
const { answer } = await makeItReal();
|
|
const insert = answer.getByTestId('answer-insert-below');
|
|
await insert.click();
|
|
await utils.chatPanel.waitForHistory(page, [
|
|
{
|
|
role: 'action',
|
|
},
|
|
]);
|
|
const {
|
|
answer: panelAnswer,
|
|
prompt,
|
|
actionName,
|
|
} = await utils.chatPanel.getLatestAIActionMessage(page);
|
|
await expect(panelAnswer.locator('affine-code')).toBeVisible();
|
|
await expect(prompt).toHaveText(/Write a web page of follow text/);
|
|
await expect(actionName).toHaveText(/Make it real with text/);
|
|
});
|
|
});
|