Fix tests

This commit is contained in:
Mark Tolmacs 2025-03-19 10:59:54 +01:00
parent 35c4c074d7
commit 126c7caabc
4 changed files with 7 additions and 11 deletions

View file

@ -254,11 +254,11 @@ describe("actionDuplicateSelection", () => {
act(() => {
h.app.actionManager.executeAction(actionDuplicateSelection);
});
console.log(h.elements, h.state.selectedElementIds);
assertElements(h.elements, [
{ id: frame.id },
{ id: text.id, frameId: frame.id },
{ [ORIG_ID]: text.id, frameId: frame.id },
{ [ORIG_ID]: text.id, frameId: frame.id, selected: true },
]);
});

View file

@ -285,7 +285,7 @@ describe("duplicating multiple elements", () => {
const arrow3 = API.createElement({
type: "arrow",
id: "arrow2",
id: "arrow3",
startBinding: {
elementId: "rectangle-not-exists",
focus: 0.2,
@ -306,6 +306,7 @@ describe("duplicating multiple elements", () => {
const { newElements: clonedElements } = duplicateElements(
origElements,
) as any as { newElements: typeof origElements };
const [
clonedRectangle,
clonedText1,
@ -325,7 +326,6 @@ describe("duplicating multiple elements", () => {
elementId: clonedRectangle.id,
});
expect(clonedArrow2.endBinding).toBe(null);
console.log(clonedArrow3);
expect(clonedArrow3.startBinding).toBe(null);
expect(clonedArrow3.endBinding).toEqual({
...arrow3.endBinding,

View file

@ -1185,9 +1185,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
},
"suggestedBindings": [],
"theme": "light",
"toast": {
"message": "Added to library",
},
"toast": null,
"userToFollow": null,
"viewBackgroundColor": "#ffffff",
"viewModeEnabled": false,

View file

@ -924,12 +924,11 @@ History {
],
],
"startBinding": null,
"y": 0,
},
"inserted": {
"endBinding": {
"elementId": "id166",
"focus": "0.00000",
"focus": -0,
"gap": 1,
},
"points": [
@ -944,10 +943,9 @@ History {
],
"startBinding": {
"elementId": "id165",
"focus": "-0.00000",
"focus": 0,
"gap": 1,
},
"y": "0.00000",
},
},
},