mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
feat(server): refactor copilot (#14892)
#### PR Dependency Tree * **PR #14892** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
@@ -61,13 +61,20 @@ export class TestUtils {
|
||||
await waitForEditorLoad(page);
|
||||
}
|
||||
|
||||
public async setupTestEnvironment(
|
||||
page: Page,
|
||||
defaultModel = 'gemini-2.5-flash'
|
||||
) {
|
||||
await switchDefaultChatModel(defaultModel);
|
||||
public async setupTestEnvironment(page: Page, defaultModel?: string) {
|
||||
const hasExplicitModel = defaultModel !== undefined;
|
||||
const selectedModel = defaultModel ?? 'gemini-2.5-flash';
|
||||
await switchDefaultChatModel(selectedModel);
|
||||
|
||||
await skipOnboarding(page.context());
|
||||
if (hasExplicitModel) {
|
||||
await page.context().addInitScript(model => {
|
||||
window.localStorage.setItem(
|
||||
'global-state:AIModelId',
|
||||
JSON.stringify(model)
|
||||
);
|
||||
}, selectedModel);
|
||||
}
|
||||
await openHomePage(page);
|
||||
await this.createNewPage(page);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user