mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): no pop-ups if user click discard menu item (#10317)
Fix issue [BS-2628](https://linear.app/affine-design/issue/BS-2628).
This commit is contained in:
@@ -436,7 +436,7 @@ test.describe('chat panel', () => {
|
||||
expect(editorContent).toBe(content);
|
||||
});
|
||||
|
||||
test('can be retry or discard chat in page mode', async ({ page }) => {
|
||||
test('can regenerate chat in page mode', async ({ page }) => {
|
||||
await page.reload();
|
||||
await clickSideBarAllPageButton(page);
|
||||
await page.waitForTimeout(200);
|
||||
@@ -467,13 +467,53 @@ test.describe('chat panel', () => {
|
||||
).innerText()
|
||||
).not.toBe(content);
|
||||
}
|
||||
});
|
||||
|
||||
// discard
|
||||
test('can discard chat in page mode', async ({ page }) => {
|
||||
await page.reload();
|
||||
await clickSideBarAllPageButton(page);
|
||||
await page.waitForTimeout(200);
|
||||
await createLocalWorkspace({ name: 'test' }, page);
|
||||
await clickNewPageButton(page);
|
||||
await focusToEditor(page);
|
||||
await page.keyboard.type('/');
|
||||
await page.getByTestId('sub-menu-0').getByText('Ask AI').click();
|
||||
const input = await page.waitForSelector('ai-panel-input textarea');
|
||||
await input.fill('hello');
|
||||
await input.press('Enter');
|
||||
|
||||
// discard without confirm modal
|
||||
{
|
||||
const resp = await page.waitForSelector(
|
||||
'ai-panel-answer .response-list-container:last-child'
|
||||
);
|
||||
await (await resp.waitForSelector('.ai-item-discard')).click();
|
||||
const editorContent = await getEditorContent(page);
|
||||
expect(editorContent).toBe('');
|
||||
}
|
||||
});
|
||||
|
||||
test('can discard chat with confirm modal in edgeless mode', async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.reload();
|
||||
await clickSideBarAllPageButton(page);
|
||||
await page.waitForTimeout(200);
|
||||
await createLocalWorkspace({ name: 'test' }, page);
|
||||
await clickNewPageButton(page);
|
||||
await focusToEditor(page);
|
||||
await page.keyboard.type('/');
|
||||
await page.getByTestId('sub-menu-0').getByText('Ask AI').click();
|
||||
const input = await page.waitForSelector('ai-panel-input textarea');
|
||||
await input.fill('hello');
|
||||
await input.press('Enter');
|
||||
|
||||
// discard with confirm modal
|
||||
{
|
||||
await page.waitForSelector(
|
||||
'ai-panel-answer .response-list-container:last-child'
|
||||
);
|
||||
await page.mouse.click(100, 100);
|
||||
await page.getByTestId('confirm-modal-confirm').click();
|
||||
const editorContent = await getEditorContent(page);
|
||||
expect(editorContent).toBe('');
|
||||
|
||||
Reference in New Issue
Block a user