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 -->
62 lines
2.0 KiB
TypeScript
62 lines
2.0 KiB
TypeScript
import { expect } from '@playwright/test';
|
|
|
|
import { test } from '../base/base-test';
|
|
|
|
test.describe('AIAction/GeneratePresentation', () => {
|
|
test.describe.configure({ timeout: 240000 });
|
|
|
|
test.beforeEach(async ({ loggedInPage: page, utils }) => {
|
|
await utils.testUtils.setupTestEnvironment(page);
|
|
await utils.chatPanel.openChatPanel(page);
|
|
});
|
|
|
|
test('should generate a presentation for the selected content', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
const { generatePresentation } = await utils.editor.askAIWithText(
|
|
page,
|
|
'AFFiNE is a workspace with fully merged docs'
|
|
);
|
|
const { answer, responses } = await generatePresentation();
|
|
await expect(answer.locator('ai-slides-renderer')).toBeVisible();
|
|
expect(responses).toEqual(new Set(['insert-below']));
|
|
});
|
|
|
|
test('should generate a presentation for the selected text block in edgeless', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
const { generatePresentation } = await utils.editor.askAIWithEdgeless(
|
|
page,
|
|
async () => {
|
|
await utils.editor.createEdgelessText(
|
|
page,
|
|
'AFFiNE is a workspace with fully merged docs'
|
|
);
|
|
}
|
|
);
|
|
const { answer, responses } = await generatePresentation();
|
|
await expect(answer.locator('ai-slides-renderer')).toBeVisible();
|
|
expect(responses).toEqual(new Set(['insert-below']));
|
|
});
|
|
|
|
test('should generate a presentation for the selected note block in edgeless', async ({
|
|
loggedInPage: page,
|
|
utils,
|
|
}) => {
|
|
const { generatePresentation } = await utils.editor.askAIWithEdgeless(
|
|
page,
|
|
async () => {
|
|
await utils.editor.createEdgelessNote(
|
|
page,
|
|
'AFFiNE is a workspace with fully merged docs'
|
|
);
|
|
}
|
|
);
|
|
const { answer, responses } = await generatePresentation();
|
|
await expect(answer.locator('ai-slides-renderer')).toBeVisible();
|
|
expect(responses).toEqual(new Set(['insert-below']));
|
|
});
|
|
});
|