mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 22:38:56 +08:00
fix(editor): should exit drawing tools menu when Escape is pressed (#11306)
Closes: [BS-2978](https://linear.app/affine-design/issue/BS-2978/二级菜单的激活状态错误) [BS-2977](https://linear.app/affine-design/issue/BS-2977/pen和highlighter没做esc)
This commit is contained in:
@@ -43,3 +43,17 @@ test('should add highlighter', async ({ page }) => {
|
||||
|
||||
expect(defaultLineWidth).toBe('22');
|
||||
});
|
||||
|
||||
test('should exit drawing tools menu when Escape is pressed', async ({
|
||||
page,
|
||||
}) => {
|
||||
await setEdgelessTool(page, 'highlighter');
|
||||
|
||||
const drawingToolsMenu = page.locator('edgeless-pen-menu');
|
||||
|
||||
await expect(drawingToolsMenu).toBeVisible();
|
||||
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
await expect(drawingToolsMenu).toBeHidden();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user