mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix tests
This commit is contained in:
parent
35c4c074d7
commit
126c7caabc
4 changed files with 7 additions and 11 deletions
|
@ -254,11 +254,11 @@ describe("actionDuplicateSelection", () => {
|
||||||
act(() => {
|
act(() => {
|
||||||
h.app.actionManager.executeAction(actionDuplicateSelection);
|
h.app.actionManager.executeAction(actionDuplicateSelection);
|
||||||
});
|
});
|
||||||
|
console.log(h.elements, h.state.selectedElementIds);
|
||||||
assertElements(h.elements, [
|
assertElements(h.elements, [
|
||||||
{ id: frame.id },
|
{ id: frame.id },
|
||||||
{ id: text.id, frameId: frame.id },
|
{ id: text.id, frameId: frame.id },
|
||||||
{ [ORIG_ID]: text.id, frameId: frame.id },
|
{ [ORIG_ID]: text.id, frameId: frame.id, selected: true },
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ describe("duplicating multiple elements", () => {
|
||||||
|
|
||||||
const arrow3 = API.createElement({
|
const arrow3 = API.createElement({
|
||||||
type: "arrow",
|
type: "arrow",
|
||||||
id: "arrow2",
|
id: "arrow3",
|
||||||
startBinding: {
|
startBinding: {
|
||||||
elementId: "rectangle-not-exists",
|
elementId: "rectangle-not-exists",
|
||||||
focus: 0.2,
|
focus: 0.2,
|
||||||
|
@ -306,6 +306,7 @@ describe("duplicating multiple elements", () => {
|
||||||
const { newElements: clonedElements } = duplicateElements(
|
const { newElements: clonedElements } = duplicateElements(
|
||||||
origElements,
|
origElements,
|
||||||
) as any as { newElements: typeof origElements };
|
) as any as { newElements: typeof origElements };
|
||||||
|
|
||||||
const [
|
const [
|
||||||
clonedRectangle,
|
clonedRectangle,
|
||||||
clonedText1,
|
clonedText1,
|
||||||
|
@ -325,7 +326,6 @@ describe("duplicating multiple elements", () => {
|
||||||
elementId: clonedRectangle.id,
|
elementId: clonedRectangle.id,
|
||||||
});
|
});
|
||||||
expect(clonedArrow2.endBinding).toBe(null);
|
expect(clonedArrow2.endBinding).toBe(null);
|
||||||
console.log(clonedArrow3);
|
|
||||||
expect(clonedArrow3.startBinding).toBe(null);
|
expect(clonedArrow3.startBinding).toBe(null);
|
||||||
expect(clonedArrow3.endBinding).toEqual({
|
expect(clonedArrow3.endBinding).toEqual({
|
||||||
...arrow3.endBinding,
|
...arrow3.endBinding,
|
||||||
|
|
|
@ -1185,9 +1185,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
|
||||||
},
|
},
|
||||||
"suggestedBindings": [],
|
"suggestedBindings": [],
|
||||||
"theme": "light",
|
"theme": "light",
|
||||||
"toast": {
|
"toast": null,
|
||||||
"message": "Added to library",
|
|
||||||
},
|
|
||||||
"userToFollow": null,
|
"userToFollow": null,
|
||||||
"viewBackgroundColor": "#ffffff",
|
"viewBackgroundColor": "#ffffff",
|
||||||
"viewModeEnabled": false,
|
"viewModeEnabled": false,
|
||||||
|
|
|
@ -924,12 +924,11 @@ History {
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
"startBinding": null,
|
"startBinding": null,
|
||||||
"y": 0,
|
|
||||||
},
|
},
|
||||||
"inserted": {
|
"inserted": {
|
||||||
"endBinding": {
|
"endBinding": {
|
||||||
"elementId": "id166",
|
"elementId": "id166",
|
||||||
"focus": "0.00000",
|
"focus": -0,
|
||||||
"gap": 1,
|
"gap": 1,
|
||||||
},
|
},
|
||||||
"points": [
|
"points": [
|
||||||
|
@ -944,10 +943,9 @@ History {
|
||||||
],
|
],
|
||||||
"startBinding": {
|
"startBinding": {
|
||||||
"elementId": "id165",
|
"elementId": "id165",
|
||||||
"focus": "-0.00000",
|
"focus": 0,
|
||||||
"gap": 1,
|
"gap": 1,
|
||||||
},
|
},
|
||||||
"y": "0.00000",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue