fundon
2025-04-03 03:27:25 +00:00
parent c61df18ab9
commit a1500e3ee1
5 changed files with 34 additions and 5 deletions
@@ -127,4 +127,15 @@ test.describe('AIChatWith/Text', () => {
const content = await utils.editor.getEditorContent(page);
expect(content).toBe('Apple');
});
test('should focus on textarea', async ({ page, utils }) => {
await utils.editor.askAIWithText(page, 'Apple');
const textarea = await utils.editor.whatAreYourThoughts(page, 'Coffee');
await expect(textarea).toBeFocused();
const value = await textarea.inputValue();
expect(value).toBe('Coffee');
});
});
@@ -582,4 +582,12 @@ export class EditorUtils {
),
} as const;
}
public static async whatAreYourThoughts(page: Page, text: string) {
const textarea = page.locator(
'affine-ai-panel-widget .ai-panel-container textarea'
);
await textarea.fill(text);
return textarea;
}
}