mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Merge remote-tracking branch 'origin/release' into danieljgeiger-mathjax
This commit is contained in:
commit
28261c4b29
23 changed files with 480 additions and 72 deletions
|
@ -119,6 +119,15 @@ Object {
|
|||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"contextItemLabel": "labels.createContainerFromText",
|
||||
"name": "createContainerFromText",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": Object {
|
||||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"PanelComponent": [Function],
|
||||
"contextItemLabel": "labels.ungroup",
|
||||
|
@ -4507,6 +4516,15 @@ Object {
|
|||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"contextItemLabel": "labels.createContainerFromText",
|
||||
"name": "createContainerFromText",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": Object {
|
||||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"PanelComponent": [Function],
|
||||
"contextItemLabel": "labels.ungroup",
|
||||
|
@ -5048,6 +5066,15 @@ Object {
|
|||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"contextItemLabel": "labels.createContainerFromText",
|
||||
"name": "createContainerFromText",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": Object {
|
||||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"PanelComponent": [Function],
|
||||
"contextItemLabel": "labels.ungroup",
|
||||
|
@ -5888,6 +5915,15 @@ Object {
|
|||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"contextItemLabel": "labels.createContainerFromText",
|
||||
"name": "createContainerFromText",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": Object {
|
||||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"PanelComponent": [Function],
|
||||
"contextItemLabel": "labels.ungroup",
|
||||
|
@ -6225,6 +6261,15 @@ Object {
|
|||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"contextItemLabel": "labels.createContainerFromText",
|
||||
"name": "createContainerFromText",
|
||||
"perform": [Function],
|
||||
"predicate": [Function],
|
||||
"trackEvent": Object {
|
||||
"category": "element",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"PanelComponent": [Function],
|
||||
"contextItemLabel": "labels.ungroup",
|
||||
|
|
30
src/tests/shortcuts.test.tsx
Normal file
30
src/tests/shortcuts.test.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { KEYS } from "../keys";
|
||||
import { Excalidraw } from "../packages/excalidraw/entry";
|
||||
import { API } from "./helpers/api";
|
||||
import { Keyboard } from "./helpers/ui";
|
||||
import { fireEvent, render, waitFor } from "./test-utils";
|
||||
|
||||
describe("shortcuts", () => {
|
||||
it("Clear canvas shortcut should display confirm dialog", async () => {
|
||||
await render(
|
||||
<Excalidraw
|
||||
initialData={{ elements: [API.createElement({ type: "rectangle" })] }}
|
||||
handleKeyboardGlobally
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(window.h.elements.length).toBe(1);
|
||||
|
||||
Keyboard.withModifierKeys({ ctrl: true }, () => {
|
||||
Keyboard.keyDown(KEYS.DELETE);
|
||||
});
|
||||
const confirmDialog = document.querySelector(".confirm-dialog")!;
|
||||
expect(confirmDialog).not.toBe(null);
|
||||
|
||||
fireEvent.click(confirmDialog.querySelector('[aria-label="Confirm"]')!);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(window.h.elements[0].isDeleted).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue