mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
fix(editor): undo should remove the new frame created by dragging (#11303)
Close [BS-2848](https://linear.app/affine-design/issue/BS-2848/但我发现frame创建后,要撤销两次才能删掉)
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
pressBackspace,
|
||||
pressEscape,
|
||||
SHORT_KEY,
|
||||
undoByKeyboard,
|
||||
} from '../../utils/actions/keyboard.js';
|
||||
import {
|
||||
assertCanvasElementsCount,
|
||||
@@ -412,3 +413,10 @@ test('outline should keep updated during a new frame created by frame-tool dragg
|
||||
await pickColorAtPoints(page, [start, [end[0] - 1, end[1] - 1]])
|
||||
).toEqual(['#1e96eb', '#1e96eb']);
|
||||
});
|
||||
|
||||
test('undo should work when create a frame by dragging', async ({ page }) => {
|
||||
await page.keyboard.press('f');
|
||||
await dragBetweenViewCoords(page, [0, 0], [100, 100], { steps: 50 });
|
||||
await undoByKeyboard(page);
|
||||
await expect(page.locator('affine-frame')).toHaveCount(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user