Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Tests for groups, more test utils (#1669)

Pete Hunt56f8bc092da1
diff --git a/src/actions/actionGroup.ts b/src/actions/actionGroup.ts
index 3538cf2d24..746c6b3d7f 100644
--- a/src/actions/actionGroup.ts
+++ b/src/actions/actionGroup.ts
@@ -1,6 +1,5 @@
import { KEYS } from "../keys";
import { register } from "./register";
-import nanoid from "nanoid";
import { newElementWith } from "../element/mutateElement";
import { getSelectedElements } from "../scene";
import {
@@ -13,6 +12,7 @@ import {
isElementInGroup,
} from "../groups";
import { getNonDeletedElements } from "../element";
+import { randomId } from "../random";
export const actionGroup = register({
name: "group",
@@ -46,7 +46,7 @@ export const actionGroup = register({
return { appState, elements, commitToHistory: false };
}
}
- const newGroupId = nanoid();
+ const newGroupId = randomId();
const updatedElements = elements.map((element) => {
if (!appState.selectedElementIds[element.id]) {
return element;
diff --git a/src/element/newElement.ts b/src/element/newElement.ts
index 68da072da5..a9ab789a45 100644
--- a/src/element/newElement.ts
+++ b/src/element/newElement.ts
@@ -11,7 +11,6 @@ import {
import { measureText, getFontString } from "../utils";
import { randomInteger, randomId } from "../random";
import { newElementWith } from "./mutateElement";
-import nanoid from "nanoid";
import { getNewGroupIdsForDuplication } from "../groups";
type ElementConstructorOpts = {
@@ -183,7 +182,7 @@ export const duplicateElement = <TElement extends Mutable<ExcalidrawElement>>(
editingGroupId,
(groupId) => {
if (!groupIdMapForOperation.has(groupId)) {
- groupIdMapForOperation.set(groupId, nanoid());
+ groupIdMapForOperation.set(groupId, randomId());
}
return groupIdMapForOperation.get(groupId)!;
},
diff --git a/src/tests/__snapshots__/regressionTests.test.tsx.snap b/src/tests/__snapshots__/regressionTests.test.tsx.snap
index 45bd1b7cf3..748a2bb4ac 100644
--- a/src/tests/__snapshots__/regressionTests.test.tsx.snap
+++ b/src/tests/__snapshots__/regressionTests.test.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`regression tests alt-drag duplicates an element: [end of test] appState 1`] = `
+exports[`regression tests adjusts z order when grouping: [end of test] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -29,7 +29,7 @@ Object {
"isRotating": false,
"lastPointerDownWith": "mouse",
"multiElement": null,
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"openMenu": null,
"resizingElement": null,
"scrollX": 0,
@@ -37,9 +37,13 @@ Object {
"scrolledOutside": false,
"selectedElementIds": Object {
"id0": true,
- "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ },
+ "selectedGroupIds": Object {
+ "id5": true,
},
- "selectedGroupIds": Object {},
"selectionElement": null,
"shouldAddWatermark": false,
"shouldCacheIgnoreZoom": false,
@@ -51,36 +55,38 @@ Object {
}
`;
-exports[`regression tests alt-drag duplicates an element: [end of test] element 0 1`] = `
+exports[`regression tests adjusts z order when grouping: [end of test] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
"height": 10,
- "id": "id2",
+ "id": "id1",
"isDeleted": false,
"opacity": 100,
"roughness": 1,
- "seed": 401146281,
+ "seed": 449462985,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
+ "version": 2,
+ "versionNonce": 453191,
"width": 10,
- "x": 10,
+ "x": 30,
"y": 10,
}
`;
-exports[`regression tests alt-drag duplicates an element: [end of test] element 1 1`] = `
+exports[`regression tests adjusts z order when grouping: [end of test] element 1 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id5",
+ ],
"height": 10,
"id": "id0",
"isDeleted": false,
@@ -92,21 +98,47 @@ Object {
"strokeWidth": 1,
"type": "rectangle",
"version": 3,
- "versionNonce": 453191,
+ "versionNonce": 1014066025,
"width": 10,
- "x": 20,
- "y": 20,
+ "x": 10,
+ "y": 10,
}
`;
-exports[`regression tests alt-drag duplicates an element: [end of test] history 1`] = `
+exports[`regression tests adjusts z order when grouping: [end of test] element 2 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id5",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 238820263,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+}
+`;
+
+exports[`regression tests adjusts z order when grouping: [end of test] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
"stateHistory": Array [
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
"id0": true,
},
@@ -138,14 +170,108 @@ Object {
},
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
- "id0": true,
"id1": true,
},
"viewBackgroundColor": "#ffffff",
},
"elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id2": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -161,18 +287,55 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 4,
+ "version": 2,
"versionNonce": 2019559783,
"width": 10,
- "x": 10,
+ "x": 50,
"y": 10,
},
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
"height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id5",
+ ],
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -183,10 +346,33 @@ Object {
"strokeWidth": 1,
"type": "rectangle",
"version": 3,
- "versionNonce": 453191,
+ "versionNonce": 1014066025,
"width": 10,
- "x": 20,
- "y": 20,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id5",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 238820263,
+ "width": 10,
+ "x": 50,
+ "y": 10,
},
],
},
@@ -194,11 +380,11 @@ Object {
}
`;
-exports[`regression tests alt-drag duplicates an element: [end of test] number of elements 1`] = `2`;
+exports[`regression tests adjusts z order when grouping: [end of test] number of elements 1`] = `3`;
-exports[`regression tests alt-drag duplicates an element: [end of test] number of renders 1`] = `9`;
+exports[`regression tests adjusts z order when grouping: [end of test] number of renders 1`] = `19`;
-exports[`regression tests arrow keys: [end of test] appState 1`] = `
+exports[`regression tests alt-drag duplicates an element: [end of test] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -235,6 +421,7 @@ Object {
"scrolledOutside": false,
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -248,7 +435,31 @@ Object {
}
`;
-exports[`regression tests arrow keys: [end of test] element 0 1`] = `
+exports[`regression tests alt-drag duplicates an element: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests alt-drag duplicates an element: [end of test] element 1 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -264,15 +475,188 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 8,
- "versionNonce": 1116226695,
+ "version": 3,
+ "versionNonce": 453191,
"width": 10,
- "x": 9,
- "y": 9,
+ "x": 20,
+ "y": 20,
}
`;
-exports[`regression tests arrow keys: [end of test] history 1`] = `
+exports[`regression tests alt-drag duplicates an element: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 20,
+ "y": 20,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests alt-drag duplicates an element: [end of test] number of elements 1`] = `2`;
+
+exports[`regression tests alt-drag duplicates an element: [end of test] number of renders 1`] = `9`;
+
+exports[`regression tests arrow keys: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests arrow keys: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 8,
+ "versionNonce": 1116226695,
+ "width": 10,
+ "x": 9,
+ "y": 9,
+}
+`;
+
+exports[`regression tests arrow keys: [end of test] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -1396,9 +1780,9 @@ Object {
exports[`regression tests click-drag to select a group: [end of test] number of elements 1`] = `3`;
-exports[`regression tests click-drag to select a group: [end of test] number of renders 1`] = `17`;
+exports[`regression tests click-drag to select a group: [end of test] number of renders 1`] = `18`;
-exports[`regression tests draw every type of shape: [end of test] appState 1`] = `
+exports[`regression tests double click to edit a group: [end of test] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -1411,12 +1795,12 @@ Object {
"currentItemStrokeStyle": "solid",
"currentItemStrokeWidth": 1,
"currentItemTextAlign": "left",
- "cursorButton": "down",
+ "cursorButton": "up",
"cursorX": 0,
"cursorY": 0,
"draggingElement": null,
"editingElement": null,
- "editingGroupId": null,
+ "editingGroupId": "id3",
"elementLocked": false,
"elementType": "selection",
"errorMessage": null,
@@ -1427,14 +1811,14 @@ Object {
"isRotating": false,
"lastPointerDownWith": "mouse",
"multiElement": null,
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"openMenu": null,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
"scrolledOutside": false,
"selectedElementIds": Object {
- "id7": true,
+ "id2": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -1448,12 +1832,14 @@ Object {
}
`;
-exports[`regression tests draw every type of shape: [end of test] element 0 1`] = `
+exports[`regression tests double click to edit a group: [end of test] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id0",
"isDeleted": false,
@@ -1464,20 +1850,22 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 3,
+ "versionNonce": 1150084233,
"width": 10,
"x": 10,
"y": 10,
}
`;
-exports[`regression tests draw every type of shape: [end of test] element 1 1`] = `
+exports[`regression tests double click to edit a group: [end of test] element 1 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id1",
"isDeleted": false,
@@ -1487,21 +1875,23 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "diamond",
- "version": 2,
- "versionNonce": 453191,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 1116226695,
"width": 10,
"x": 30,
"y": 10,
}
`;
-exports[`regression tests draw every type of shape: [end of test] element 2 1`] = `
+exports[`regression tests double click to edit a group: [end of test] element 2 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id2",
"isDeleted": false,
@@ -1511,136 +1901,23 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "ellipse",
- "version": 2,
- "versionNonce": 2019559783,
- "width": 10,
- "x": 50,
- "y": 10,
-}
-`;
-
-exports[`regression tests draw every type of shape: [end of test] element 3 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id3",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 1150084233,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "arrow",
+ "type": "rectangle",
"version": 3,
"versionNonce": 1014066025,
"width": 10,
- "x": 70,
+ "x": 50,
"y": 10,
}
`;
-exports[`regression tests draw every type of shape: [end of test] element 4 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id4",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 238820263,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "line",
- "version": 3,
- "versionNonce": 1604849351,
- "width": 10,
- "x": 90,
- "y": 10,
-}
-`;
-
-exports[`regression tests draw every type of shape: [end of test] element 5 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id7",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 640725609,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "draw",
- "version": 3,
- "versionNonce": 941653321,
- "width": 10,
- "x": 30,
- "y": 10,
-}
-`;
-
-exports[`regression tests draw every type of shape: [end of test] history 1`] = `
+exports[`regression tests double click to edit a group: [end of test] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
"stateHistory": Array [
Object {
"appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {},
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
"id0": true,
},
@@ -1672,7 +1949,7 @@ Object {
},
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
"id1": true,
},
@@ -1714,7 +1991,7 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "diamond",
+ "type": "rectangle",
"version": 2,
"versionNonce": 453191,
"width": 10,
@@ -1725,7 +2002,7 @@ Object {
},
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
"id2": true,
},
@@ -1767,7 +2044,7 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "diamond",
+ "type": "rectangle",
"version": 2,
"versionNonce": 453191,
"width": 10,
@@ -1788,7 +2065,7 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "ellipse",
+ "type": "rectangle",
"version": 2,
"versionNonce": 2019559783,
"width": 10,
@@ -1799,9 +2076,11 @@ Object {
},
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
- "id3": true,
+ "id0": true,
+ "id1": true,
+ "id2": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -1810,7 +2089,9 @@ Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id0",
"isDeleted": false,
@@ -1821,8 +2102,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 3,
+ "versionNonce": 1150084233,
"width": 10,
"x": 10,
"y": 10,
@@ -1831,7 +2112,9 @@ Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id1",
"isDeleted": false,
@@ -1841,9 +2124,9 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "diamond",
- "version": 2,
- "versionNonce": 453191,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 1116226695,
"width": 10,
"x": 30,
"y": 10,
@@ -1852,7 +2135,9 @@ Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id2",
"isDeleted": false,
@@ -1862,351 +2147,11 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "ellipse",
- "version": 2,
- "versionNonce": 2019559783,
- "width": 10,
- "x": 50,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id3",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 1150084233,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "arrow",
+ "type": "rectangle",
"version": 3,
"versionNonce": 1014066025,
"width": 10,
- "x": 70,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id4": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id1",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 449462985,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "diamond",
- "version": 2,
- "versionNonce": 453191,
- "width": 10,
- "x": 30,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id2",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 401146281,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "ellipse",
- "version": 2,
- "versionNonce": 2019559783,
- "width": 10,
- "x": 50,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id3",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 1150084233,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "arrow",
- "version": 3,
- "versionNonce": 1014066025,
- "width": 10,
- "x": 70,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id4",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 238820263,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "line",
- "version": 3,
- "versionNonce": 1604849351,
- "width": 10,
- "x": 90,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id7": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id1",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 449462985,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "diamond",
- "version": 2,
- "versionNonce": 453191,
- "width": 10,
- "x": 30,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id2",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 401146281,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "ellipse",
- "version": 2,
- "versionNonce": 2019559783,
- "width": 10,
- "x": 50,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id3",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 1150084233,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "arrow",
- "version": 3,
- "versionNonce": 1014066025,
- "width": 10,
- "x": 70,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id4",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 238820263,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "line",
- "version": 3,
- "versionNonce": 1604849351,
- "width": 10,
- "x": 90,
- "y": 10,
- },
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id7",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 640725609,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "draw",
- "version": 3,
- "versionNonce": 941653321,
- "width": 10,
- "x": 30,
+ "x": 50,
"y": 10,
},
],
@@ -2215,11 +2160,11 @@ Object {
}
`;
-exports[`regression tests draw every type of shape: [end of test] number of elements 1`] = `6`;
+exports[`regression tests double click to edit a group: [end of test] number of elements 1`] = `3`;
-exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `38`;
+exports[`regression tests double click to edit a group: [end of test] number of renders 1`] = `17`;
-exports[`regression tests hotkey 2 selects rectangle tool: [end of test] appState 1`] = `
+exports[`regression tests draw every type of shape: [end of test] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -2232,7 +2177,7 @@ Object {
"currentItemStrokeStyle": "solid",
"currentItemStrokeWidth": 1,
"currentItemTextAlign": "left",
- "cursorButton": "up",
+ "cursorButton": "down",
"cursorX": 0,
"cursorY": 0,
"draggingElement": null,
@@ -2255,7 +2200,7 @@ Object {
"scrollY": 0,
"scrolledOutside": false,
"selectedElementIds": Object {
- "id0": true,
+ "id7": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -2269,7 +2214,7 @@ Object {
}
`;
-exports[`regression tests hotkey 2 selects rectangle tool: [end of test] element 0 1`] = `
+exports[`regression tests draw every type of shape: [end of test] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -2293,130 +2238,256 @@ Object {
}
`;
-exports[`regression tests hotkey 2 selects rectangle tool: [end of test] history 1`] = `
+exports[`regression tests draw every type of shape: [end of test] element 1 1`] = `
Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- ],
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
}
`;
-exports[`regression tests hotkey 2 selects rectangle tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey 2 selects rectangle tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey 3 selects diamond tool: [end of test] appState 1`] = `
+exports[`regression tests draw every type of shape: [end of test] element 2 1`] = `
Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
}
`;
-exports[`regression tests hotkey 3 selects diamond tool: [end of test] element 0 1`] = `
+exports[`regression tests draw every type of shape: [end of test] element 3 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
"height": 10,
- "id": "id0",
+ "id": "id3",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1150084233,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 70,
+ "y": 10,
+}
+`;
+
+exports[`regression tests draw every type of shape: [end of test] element 4 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id4",
"isDeleted": false,
+ "lastCommittedPoint": null,
"opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
"roughness": 1,
- "seed": 337897,
+ "seed": 238820263,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "diamond",
- "version": 2,
- "versionNonce": 1278240551,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 1604849351,
"width": 10,
- "x": 10,
+ "x": 90,
"y": 10,
}
`;
-exports[`regression tests hotkey 3 selects diamond tool: [end of test] history 1`] = `
+exports[`regression tests draw every type of shape: [end of test] element 5 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id5",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1505387817,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 7,
+ "versionNonce": 1723083209,
+ "width": 10,
+ "x": 110,
+ "y": 10,
+}
+`;
+
+exports[`regression tests draw every type of shape: [end of test] element 6 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id6",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 760410951,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 7,
+ "versionNonce": 406373543,
+ "width": 10,
+ "x": 120,
+ "y": 10,
+}
+`;
+
+exports[`regression tests draw every type of shape: [end of test] element 7 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id7",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 941653321,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "draw",
+ "version": 3,
+ "versionNonce": 1402203177,
+ "width": 10,
+ "x": 130,
+ "y": 10,
+}
+`;
+
+exports[`regression tests draw every type of shape: [end of test] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
"stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {},
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [],
+ },
Object {
"appState": Object {
"name": "Untitled-201933152653",
@@ -2440,7 +2511,7 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "diamond",
+ "type": "rectangle",
"version": 2,
"versionNonce": 1278240551,
"width": 10,
@@ -2449,98 +2520,11 @@ Object {
},
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey 3 selects diamond tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey 3 selects diamond tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey 4 selects ellipse tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey 4 selects ellipse tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "ellipse",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey 4 selects ellipse tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
- "id0": true,
+ "id1": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -2559,118 +2543,41 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "ellipse",
+ "type": "rectangle",
"version": 2,
"versionNonce": 1278240551,
"width": 10,
"x": 10,
"y": 10,
},
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey 4 selects ellipse tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey 4 selects ellipse tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey 5 selects arrow tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey 5 selects arrow tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "arrow",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey 5 selects arrow tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
- "id0": true,
+ "id2": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -2683,135 +2590,68 @@ Object {
"height": 10,
"id": "id0",
"isDeleted": false,
- "lastCommittedPoint": null,
"opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
"roughness": 1,
"seed": 337897,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "arrow",
- "version": 3,
- "versionNonce": 449462985,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
"width": 10,
"x": 10,
"y": 10,
},
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey 5 selects arrow tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey 5 selects arrow tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey 6 selects line tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey 6 selects line tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "line",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey 6 selects line tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
- "id0": true,
+ "id3": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -2824,6 +2664,69 @@ Object {
"height": 10,
"id": "id0",
"isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id3",
+ "isDeleted": false,
"lastCommittedPoint": null,
"opacity": 100,
"points": Array [
@@ -2837,122 +2740,24 @@ Object {
],
],
"roughness": 1,
- "seed": 337897,
+ "seed": 1150084233,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "line",
+ "type": "arrow",
"version": 3,
- "versionNonce": 449462985,
+ "versionNonce": 1014066025,
"width": 10,
- "x": 10,
+ "x": 70,
"y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey 6 selects line tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey 6 selects line tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey 7 selects draw tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "down",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey 7 selects draw tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "draw",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey 7 selects draw tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
- "id0": true,
+ "id4": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -2965,10 +2770,73 @@ Object {
"height": 10,
"id": "id0",
"isDeleted": false,
- "lastCommittedPoint": null,
"opacity": 100,
- "points": Array [
- Array [
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id3",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
0,
0,
],
@@ -2978,122 +2846,4102 @@ Object {
],
],
"roughness": 1,
- "seed": 337897,
+ "seed": 1150084233,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "draw",
+ "type": "arrow",
"version": 3,
- "versionNonce": 449462985,
+ "versionNonce": 1014066025,
"width": 10,
- "x": 10,
+ "x": 70,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id4",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 238820263,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 90,
"y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey 7 selects draw tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey 7 selects draw tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey a selects arrow tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey a selects arrow tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "arrow",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey a selects arrow tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
- "id0": true,
+ "id5": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id3",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1150084233,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 70,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id4",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 238820263,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 90,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id5",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 10,
+ 10,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1505387817,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 5,
+ "versionNonce": 81784553,
+ "width": 10,
+ "x": 110,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id5": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id3",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1150084233,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 70,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id4",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 238820263,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 90,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id5",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1505387817,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 7,
+ "versionNonce": 1723083209,
+ "width": 10,
+ "x": 110,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id6": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id3",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1150084233,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 70,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id4",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 238820263,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 90,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id5",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1505387817,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 7,
+ "versionNonce": 1723083209,
+ "width": 10,
+ "x": 110,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id6",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 10,
+ 10,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 760410951,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 5,
+ "versionNonce": 1898319239,
+ "width": 10,
+ "x": 120,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id6": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id3",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1150084233,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 70,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id4",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 238820263,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 90,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id5",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1505387817,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 7,
+ "versionNonce": 1723083209,
+ "width": 10,
+ "x": 110,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id6",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 760410951,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 7,
+ "versionNonce": 406373543,
+ "width": 10,
+ "x": 120,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id7": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id3",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1150084233,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 70,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id4",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 238820263,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 90,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id5",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 1505387817,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 7,
+ "versionNonce": 1723083209,
+ "width": 10,
+ "x": 110,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 20,
+ "id": "id6",
+ "isDeleted": false,
+ "lastCommittedPoint": Array [
+ 0,
+ 20,
+ ],
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ Array [
+ 0,
+ 20,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 760410951,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 7,
+ "versionNonce": 406373543,
+ "width": 10,
+ "x": 120,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id7",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 941653321,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "draw",
+ "version": 3,
+ "versionNonce": 1402203177,
+ "width": 10,
+ "x": 130,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests draw every type of shape: [end of test] number of elements 1`] = `8`;
+
+exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `46`;
+
+exports[`regression tests hotkey 2 selects rectangle tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey 2 selects rectangle tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey 2 selects rectangle tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey 2 selects rectangle tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey 2 selects rectangle tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey 3 selects diamond tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey 3 selects diamond tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey 3 selects diamond tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey 3 selects diamond tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey 3 selects diamond tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey 4 selects ellipse tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey 4 selects ellipse tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey 4 selects ellipse tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey 4 selects ellipse tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey 4 selects ellipse tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey 5 selects arrow tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey 5 selects arrow tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey 5 selects arrow tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey 5 selects arrow tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey 5 selects arrow tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey 6 selects line tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey 6 selects line tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey 6 selects line tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey 6 selects line tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey 6 selects line tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey 7 selects draw tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "down",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey 7 selects draw tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "draw",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey 7 selects draw tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "draw",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey 7 selects draw tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey 7 selects draw tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey a selects arrow tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey a selects arrow tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey a selects arrow tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "arrow",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey a selects arrow tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey a selects arrow tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey d selects diamond tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey d selects diamond tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey d selects diamond tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "diamond",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey d selects diamond tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey d selects diamond tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey e selects ellipse tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey e selects ellipse tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey e selects ellipse tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "ellipse",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey e selects ellipse tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey e selects ellipse tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey l selects line tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey l selects line tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey l selects line tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "line",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey l selects line tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey l selects line tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey r selects rectangle tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey r selects rectangle tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey r selects rectangle tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey r selects rectangle tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey r selects rectangle tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests hotkey x selects draw tool: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "down",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests hotkey x selects draw tool: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "draw",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests hotkey x selects draw tool: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "lastCommittedPoint": null,
+ "opacity": 100,
+ "points": Array [
+ Array [
+ 0,
+ 0,
+ ],
+ Array [
+ 10,
+ 10,
+ ],
+ ],
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "draw",
+ "version": 3,
+ "versionNonce": 449462985,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests hotkey x selects draw tool: [end of test] number of elements 1`] = `1`;
+
+exports[`regression tests hotkey x selects draw tool: [end of test] number of renders 1`] = `6`;
+
+exports[`regression tests make a group and duplicate it: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Unbenannt-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id5": true,
+ },
+ "selectedGroupIds": Object {
+ "id4": true,
+ },
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id7",
+ ],
+ "height": 10,
+ "id": "id6",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 915032327,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 81784553,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] element 1 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id7",
+ ],
+ "height": 10,
+ "id": "id8",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 747212839,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1723083209,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] element 2 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id7",
+ ],
+ "height": 10,
+ "id": "id9",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 760410951,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1006504105,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] element 3 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 1505387817,
+ "width": 10,
+ "x": 20,
+ "y": 20,
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] element 4 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 23633383,
+ "width": 10,
+ "x": 40,
+ "y": 20,
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] element 5 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 493213705,
+ "width": 10,
+ "x": 60,
+ "y": 20,
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id1": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id2": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 238820263,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 400692809,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id5": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id7",
+ ],
+ "height": 10,
+ "id": "id6",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 915032327,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 81784553,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id7",
+ ],
+ "height": 10,
+ "id": "id8",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 747212839,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1723083209,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id7",
+ ],
+ "height": 10,
+ "id": "id9",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 760410951,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1006504105,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 1505387817,
+ "width": 10,
+ "x": 20,
+ "y": 20,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 23633383,
+ "width": 10,
+ "x": 40,
+ "y": 20,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id4",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 493213705,
+ "width": 10,
+ "x": 60,
+ "y": 20,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests make a group and duplicate it: [end of test] number of elements 1`] = `6`;
+
+exports[`regression tests make a group and duplicate it: [end of test] number of renders 1`] = `21`;
+
+exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id1": true,
+ "id4": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 1116226695,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] element 1 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+}
+`;
+
+exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id1": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of elements 1`] = `2`;
+
+exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of renders 1`] = `18`;
+
+exports[`regression tests pinch-to-zoom works: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "down",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "touch",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": -6,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": true,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests pinch-to-zoom works: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [],
+}
+`;
+
+exports[`regression tests pinch-to-zoom works: [end of test] number of elements 1`] = `0`;
+
+exports[`regression tests pinch-to-zoom works: [end of test] number of renders 1`] = `8`;
+
+exports[`regression tests rerenders UI on language change: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "rectangle",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {},
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests rerenders UI on language change: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [],
+}
+`;
+
+exports[`regression tests rerenders UI on language change: [end of test] number of elements 1`] = `0`;
+
+exports[`regression tests rerenders UI on language change: [end of test] number of renders 1`] = `4`;
+
+exports[`regression tests resize an element, trying every resize handle: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
+ "id16": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [end of test] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 18,
+ "versionNonce": 845789479,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 453191,
+ "width": 15,
+ "x": 5,
+ "y": 5,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1116226695,
+ "width": 5,
+ "x": 15,
+ "y": 15,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 6,
+ "versionNonce": 238820263,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 7,
+ "versionNonce": 1604849351,
+ "width": 5,
+ "x": 10,
+ "y": 5,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 8,
+ "versionNonce": 23633383,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 9,
+ "versionNonce": 915032327,
+ "width": 15,
+ "x": 10,
+ "y": 15,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 10,
+ "versionNonce": 747212839,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 11,
+ "versionNonce": 760410951,
+ "width": 15,
+ "x": 5,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 12,
+ "versionNonce": 289600103,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -3103,127 +6951,41 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 15,
"id": "id0",
"isDeleted": false,
- "lastCommittedPoint": null,
"opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
"roughness": 1,
"seed": 337897,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "arrow",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
- "x": 10,
+ "type": "rectangle",
+ "version": 13,
+ "versionNonce": 1898319239,
+ "width": 5,
+ "x": 15,
"y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey a selects arrow tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey a selects arrow tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey d selects diamond tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey d selects diamond tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "diamond",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey d selects diamond tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -3242,107 +7004,79 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "diamond",
- "version": 2,
- "versionNonce": 1278240551,
+ "type": "rectangle",
+ "version": 14,
+ "versionNonce": 406373543,
"width": 10,
"x": 10,
"y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey d selects diamond tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey d selects diamond tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey e selects ellipse tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey e selects ellipse tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "ellipse",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey e selects ellipse tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 15,
+ "versionNonce": 908564423,
+ "width": 5,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -3361,118 +7095,35 @@ Object {
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "ellipse",
- "version": 2,
- "versionNonce": 1278240551,
+ "type": "rectangle",
+ "version": 16,
+ "versionNonce": 1359939303,
"width": 10,
"x": 10,
"y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey e selects ellipse tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey e selects ellipse tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey l selects line tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey l selects line tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "lastCommittedPoint": null,
- "opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "line",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey l selects line tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -3482,127 +7133,45 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 15,
"id": "id0",
"isDeleted": false,
- "lastCommittedPoint": null,
"opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
"roughness": 1,
"seed": 337897,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "line",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- ],
-}
-`;
-
-exports[`regression tests hotkey l selects line tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey l selects line tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests hotkey r selects rectangle tool: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests hotkey r selects rectangle tool: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests hotkey r selects rectangle tool: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
+ "type": "rectangle",
+ "version": 17,
+ "versionNonce": 2004587015,
+ "width": 15,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
+ "id16": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -3622,8 +7191,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 18,
+ "versionNonce": 845789479,
"width": 10,
"x": 10,
"y": 10,
@@ -3634,11 +7203,11 @@ Object {
}
`;
-exports[`regression tests hotkey r selects rectangle tool: [end of test] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [end of test] number of elements 1`] = `1`;
-exports[`regression tests hotkey r selects rectangle tool: [end of test] number of renders 1`] = `6`;
+exports[`regression tests resize an element, trying every resize handle: [end of test] number of renders 1`] = `54`;
-exports[`regression tests hotkey x selects draw tool: [end of test] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -3651,7 +7220,7 @@ Object {
"currentItemStrokeStyle": "solid",
"currentItemStrokeWidth": 1,
"currentItemTextAlign": "left",
- "cursorButton": "down",
+ "cursorButton": "up",
"cursorX": 0,
"cursorY": 0,
"draggingElement": null,
@@ -3675,6 +7244,13 @@ Object {
"scrolledOutside": false,
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -3688,42 +7264,31 @@ Object {
}
`;
-exports[`regression tests hotkey x selects draw tool: [end of test] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 5,
"id": "id0",
"isDeleted": false,
- "lastCommittedPoint": null,
"opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
"roughness": 1,
"seed": 337897,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "draw",
- "version": 3,
- "versionNonce": 449462985,
- "width": 10,
+ "type": "rectangle",
+ "version": 9,
+ "versionNonce": 915032327,
+ "width": 15,
"x": 10,
- "y": 10,
+ "y": 15,
}
`;
-exports[`regression tests hotkey x selects draw tool: [end of test] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -3745,149 +7310,132 @@ Object {
"height": 10,
"id": "id0",
"isDeleted": false,
- "lastCommittedPoint": null,
"opacity": 100,
- "points": Array [
- Array [
- 0,
- 0,
- ],
- Array [
- 10,
- 10,
- ],
- ],
"roughness": 1,
"seed": 337897,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
- "type": "draw",
- "version": 3,
- "versionNonce": 449462985,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
"width": 10,
"x": 10,
"y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests hotkey x selects draw tool: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests hotkey x selects draw tool: [end of test] number of renders 1`] = `6`;
-
-exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id1": true,
- "id4": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 4,
- "versionNonce": 1116226695,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] element 1 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id1",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 449462985,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 4,
- "versionNonce": 1014066025,
- "width": 10,
- "x": 30,
- "y": 10,
-}
-`;
-
-exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 453191,
+ "width": 15,
+ "x": 5,
+ "y": 5,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1116226695,
+ "width": 5,
+ "x": 15,
+ "y": 15,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -3907,8 +7455,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 6,
+ "versionNonce": 238820263,
"width": 10,
"x": 10,
"y": 10,
@@ -3919,7 +7467,12 @@ Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
+ "id0": true,
"id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -3929,7 +7482,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -3939,166 +7492,100 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
+ "version": 7,
+ "versionNonce": 1604849351,
+ "width": 5,
"x": 10,
- "y": 10,
+ "y": 5,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
},
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
"height": 10,
- "id": "id1",
+ "id": "id0",
"isDeleted": false,
"opacity": 100,
"roughness": 1,
- "seed": 449462985,
+ "seed": 337897,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 453191,
+ "version": 8,
+ "versionNonce": 23633383,
"width": 10,
- "x": 30,
+ "x": 10,
"y": 10,
},
],
},
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 9,
+ "versionNonce": 915032327,
+ "width": 15,
+ "x": 10,
+ "y": 15,
+ },
+ ],
+ },
],
}
`;
-exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of elements 1`] = `2`;
-
-exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of renders 1`] = `18`;
-
-exports[`regression tests pinch-to-zoom works: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "down",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "touch",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": -6,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": true,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests pinch-to-zoom works: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [],
-}
-`;
-
-exports[`regression tests pinch-to-zoom works: [end of test] number of elements 1`] = `0`;
-
-exports[`regression tests pinch-to-zoom works: [end of test] number of renders 1`] = `8`;
-
-exports[`regression tests rerenders UI on language change: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "rectangle",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {},
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests rerenders UI on language change: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [],
-}
-`;
-
-exports[`regression tests rerenders UI on language change: [end of test] number of elements 1`] = `0`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] number of elements 1`] = `1`;
-exports[`regression tests rerenders UI on language change: [end of test] number of renders 1`] = `4`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] number of renders 1`] = `27`;
-exports[`regression tests resize an element, trying every resize handle: [end of test] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -4136,21 +7623,10 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
- "id15": true,
- "id16": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -4164,13 +7640,13 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [end of test] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4180,15 +7656,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 18,
- "versionNonce": 845789479,
- "width": 10,
+ "version": 7,
+ "versionNonce": 1604849351,
+ "width": 5,
"x": 10,
- "y": 10,
+ "y": 5,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [end of test] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -4309,7 +7785,235 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1116226695,
+ "width": 5,
+ "x": 15,
+ "y": 15,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 6,
+ "versionNonce": 238820263,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 7,
+ "versionNonce": 1604849351,
+ "width": 5,
+ "x": 10,
+ "y": 5,
+ },
+ ],
+ },
+ ],
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] number of elements 1`] = `1`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] number of renders 1`] = `21`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 5,
+ "versionNonce": 1116226695,
+ "width": 5,
+ "x": 15,
+ "y": 15,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4319,11 +8023,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 5,
- "versionNonce": 1116226695,
- "width": 5,
- "x": 15,
- "y": 15,
+ "version": 3,
+ "versionNonce": 453191,
+ "width": 15,
+ "x": 5,
+ "y": 5,
},
],
},
@@ -4334,8 +8038,6 @@ Object {
"id0": true,
"id1": true,
"id2": true,
- "id3": true,
- "id4": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4355,8 +8057,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 6,
- "versionNonce": 238820263,
+ "version": 4,
+ "versionNonce": 2019559783,
"width": 10,
"x": 10,
"y": 10,
@@ -4371,8 +8073,6 @@ Object {
"id1": true,
"id2": true,
"id3": true,
- "id4": true,
- "id5": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4382,7 +8082,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4392,25 +8092,107 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 7,
- "versionNonce": 1604849351,
+ "version": 5,
+ "versionNonce": 1116226695,
"width": 5,
- "x": 10,
- "y": 5,
+ "x": 15,
+ "y": 15,
},
],
},
+ ],
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] number of elements 1`] = `1`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] number of renders 1`] = `15`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 453191,
+ "width": 15,
+ "x": 5,
+ "y": 5,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4430,8 +8212,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 8,
- "versionNonce": 23633383,
+ "version": 2,
+ "versionNonce": 1278240551,
"width": 10,
"x": 10,
"y": 10,
@@ -4444,12 +8226,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4459,7 +8235,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4469,27 +8245,121 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 9,
- "versionNonce": 915032327,
+ "version": 3,
+ "versionNonce": 453191,
"width": 15,
- "x": 10,
- "y": 15,
+ "x": 5,
+ "y": 5,
},
],
},
+ ],
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] number of elements 1`] = `1`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] number of renders 1`] = `9`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 17,
+ "versionNonce": 2004587015,
+ "width": 15,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4509,8 +8379,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
+ "version": 2,
+ "versionNonce": 1278240551,
"width": 10,
"x": 10,
"y": 10,
@@ -4523,14 +8393,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4540,7 +8402,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4550,11 +8412,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
+ "version": 3,
+ "versionNonce": 453191,
"width": 15,
"x": 5,
- "y": 10,
+ "y": 5,
},
],
},
@@ -4564,15 +8426,7 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
"id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4592,8 +8446,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
+ "version": 4,
+ "versionNonce": 2019559783,
"width": 10,
"x": 10,
"y": 10,
@@ -4606,16 +8460,8 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
"id2": true,
"id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4625,7 +8471,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4635,11 +8481,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 13,
- "versionNonce": 1898319239,
+ "version": 5,
+ "versionNonce": 1116226695,
"width": 5,
"x": 15,
- "y": 10,
+ "y": 15,
},
],
},
@@ -4649,17 +8495,9 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
"id2": true,
"id3": true,
"id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4679,8 +8517,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 14,
- "versionNonce": 406373543,
+ "version": 6,
+ "versionNonce": 238820263,
"width": 10,
"x": 10,
"y": 10,
@@ -4693,18 +8531,10 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4714,7 +8544,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4724,11 +8554,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 15,
- "versionNonce": 908564423,
+ "version": 7,
+ "versionNonce": 1604849351,
"width": 5,
"x": 10,
- "y": 10,
+ "y": 5,
},
],
},
@@ -4738,19 +8568,11 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
"id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4770,8 +8592,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 16,
- "versionNonce": 1359939303,
+ "version": 8,
+ "versionNonce": 23633383,
"width": 10,
"x": 10,
"y": 10,
@@ -4784,20 +8606,12 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
- "id15": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
"id6": true,
"id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4807,7 +8621,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -4817,11 +8631,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 17,
- "versionNonce": 2004587015,
+ "version": 9,
+ "versionNonce": 915032327,
"width": 15,
"x": 10,
- "y": 10,
+ "y": 15,
},
],
},
@@ -4831,13 +8645,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
- "id15": true,
- "id16": true,
"id2": true,
"id3": true,
"id4": true,
@@ -4845,133 +8652,6 @@ Object {
"id6": true,
"id7": true,
"id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 18,
- "versionNonce": 845789479,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- ],
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [end of test] number of elements 1`] = `1`;
-
-exports[`regression tests resize an element, trying every resize handle: [end of test] number of renders 1`] = `54`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 9,
- "versionNonce": 915032327,
- "width": 15,
- "x": 10,
- "y": 15,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -4991,8 +8671,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 10,
+ "versionNonce": 747212839,
"width": 10,
"x": 10,
"y": 10,
@@ -5005,6 +8685,14 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5014,7 +8702,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -5024,11 +8712,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 3,
- "versionNonce": 453191,
+ "version": 11,
+ "versionNonce": 760410951,
"width": 15,
"x": 5,
- "y": 5,
+ "y": 10,
},
],
},
@@ -5038,7 +8726,15 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
"id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5058,8 +8754,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
+ "version": 12,
+ "versionNonce": 289600103,
"width": 10,
"x": 10,
"y": 10,
@@ -5072,8 +8768,16 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
"id2": true,
"id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5083,7 +8787,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -5093,11 +8797,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 5,
- "versionNonce": 1116226695,
+ "version": 13,
+ "versionNonce": 1898319239,
"width": 5,
"x": 15,
- "y": 15,
+ "y": 10,
},
],
},
@@ -5107,9 +8811,17 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
"id2": true,
"id3": true,
"id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5129,8 +8841,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 6,
- "versionNonce": 238820263,
+ "version": 14,
+ "versionNonce": 406373543,
"width": 10,
"x": 10,
"y": 10,
@@ -5143,10 +8855,18 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5156,7 +8876,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -5166,11 +8886,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 7,
- "versionNonce": 1604849351,
+ "version": 15,
+ "versionNonce": 908564423,
"width": 5,
"x": 10,
- "y": 5,
+ "y": 10,
},
],
},
@@ -5180,11 +8900,19 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
"id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5204,8 +8932,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 8,
- "versionNonce": 23633383,
+ "version": 16,
+ "versionNonce": 1359939303,
"width": 10,
"x": 10,
"y": 10,
@@ -5218,12 +8946,20 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
"id6": true,
"id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5233,7 +8969,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -5243,11 +8979,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 9,
- "versionNonce": 915032327,
+ "version": 17,
+ "versionNonce": 2004587015,
"width": 15,
"x": 10,
- "y": 15,
+ "y": 10,
},
],
},
@@ -5255,11 +8991,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] number of renders 1`] = `27`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] number of renders 1`] = `51`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -5297,10 +9033,18 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -5314,13 +9058,13 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -5330,15 +9074,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 7,
- "versionNonce": 1604849351,
+ "version": 15,
+ "versionNonce": 908564423,
"width": 5,
"x": 10,
- "y": 5,
+ "y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -5494,157 +9238,73 @@ Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 6,
- "versionNonce": 238820263,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 7,
- "versionNonce": 1604849351,
- "width": 5,
- "x": 10,
- "y": 5,
- },
- ],
- },
- ],
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] number of elements 1`] = `1`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] number of renders 1`] = `21`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 5,
- "versionNonce": 1116226695,
- "width": 5,
- "x": 15,
- "y": 15,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 6,
+ "versionNonce": 238820263,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 7,
+ "versionNonce": 1604849351,
+ "width": 5,
+ "x": 10,
+ "y": 5,
+ },
+ ],
+ },
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5664,8 +9324,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 8,
+ "versionNonce": 23633383,
"width": 10,
"x": 10,
"y": 10,
@@ -5678,6 +9338,12 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5687,7 +9353,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -5697,11 +9363,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 3,
- "versionNonce": 453191,
+ "version": 9,
+ "versionNonce": 915032327,
"width": 15,
- "x": 5,
- "y": 5,
+ "x": 10,
+ "y": 15,
},
],
},
@@ -5712,6 +9378,12 @@ Object {
"id0": true,
"id1": true,
"id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5731,8 +9403,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
+ "version": 10,
+ "versionNonce": 747212839,
"width": 10,
"x": 10,
"y": 10,
@@ -5747,6 +9419,12 @@ Object {
"id1": true,
"id2": true,
"id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5766,107 +9444,116 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 5,
- "versionNonce": 1116226695,
- "width": 5,
- "x": 15,
- "y": 15,
+ "version": 11,
+ "versionNonce": 760410951,
+ "width": 15,
+ "x": 5,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 12,
+ "versionNonce": 289600103,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 15,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 13,
+ "versionNonce": 1898319239,
+ "width": 5,
+ "x": 15,
+ "y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] number of elements 1`] = `1`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] number of renders 1`] = `15`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 3,
- "versionNonce": 453191,
- "width": 15,
- "x": 5,
- "y": 5,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5886,8 +9573,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 14,
+ "versionNonce": 406373543,
"width": 10,
"x": 10,
"y": 10,
@@ -5900,6 +9587,18 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -5909,7 +9608,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -5919,11 +9618,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 3,
- "versionNonce": 453191,
- "width": 15,
- "x": 5,
- "y": 5,
+ "version": 15,
+ "versionNonce": 908564423,
+ "width": 5,
+ "x": 10,
+ "y": 10,
},
],
},
@@ -5931,11 +9630,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] number of renders 1`] = `9`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] number of renders 1`] = `45`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -5975,10 +9674,6 @@ Object {
"id1": true,
"id10": true,
"id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
- "id15": true,
"id2": true,
"id3": true,
"id4": true,
@@ -6000,7 +9695,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -6016,15 +9711,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 17,
- "versionNonce": 2004587015,
- "width": 15,
- "x": 10,
+ "version": 13,
+ "versionNonce": 1898319239,
+ "width": 5,
+ "x": 15,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -6345,178 +10040,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
- "width": 15,
- "x": 5,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 13,
- "versionNonce": 1898319239,
- "width": 5,
- "x": 15,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 14,
- "versionNonce": 406373543,
+ "version": 10,
+ "versionNonce": 747212839,
"width": 10,
"x": 10,
"y": 10,
@@ -6529,10 +10054,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
"id2": true,
"id3": true,
"id4": true,
@@ -6560,10 +10081,10 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 15,
- "versionNonce": 908564423,
- "width": 5,
- "x": 10,
+ "version": 11,
+ "versionNonce": 760410951,
+ "width": 15,
+ "x": 5,
"y": 10,
},
],
@@ -6575,10 +10096,6 @@ Object {
"id0": true,
"id1": true,
"id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
"id2": true,
"id3": true,
"id4": true,
@@ -6606,8 +10123,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 16,
- "versionNonce": 1359939303,
+ "version": 12,
+ "versionNonce": 289600103,
"width": 10,
"x": 10,
"y": 10,
@@ -6622,10 +10139,6 @@ Object {
"id1": true,
"id10": true,
"id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
- "id15": true,
"id2": true,
"id3": true,
"id4": true,
@@ -6653,10 +10166,10 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 17,
- "versionNonce": 2004587015,
- "width": 15,
- "x": 10,
+ "version": 13,
+ "versionNonce": 1898319239,
+ "width": 5,
+ "x": 15,
"y": 10,
},
],
@@ -6665,11 +10178,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] number of renders 1`] = `51`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] number of renders 1`] = `39`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -6707,10 +10220,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
"id2": true,
"id3": true,
"id4": true,
@@ -6732,7 +10241,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -6748,15 +10257,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 15,
- "versionNonce": 908564423,
- "width": 5,
- "x": 10,
+ "version": 11,
+ "versionNonce": 760410951,
+ "width": 15,
+ "x": 5,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -7126,189 +10635,15 @@ Object {
},
],
},
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 13,
- "versionNonce": 1898319239,
- "width": 5,
- "x": 15,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 14,
- "versionNonce": 406373543,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 15,
- "versionNonce": 908564423,
- "width": 5,
- "x": 10,
- "y": 10,
- },
- ],
- },
],
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] number of renders 1`] = `45`;
+exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] number of renders 1`] = `33`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -7346,8 +10681,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
"id2": true,
"id3": true,
"id4": true,
@@ -7355,7 +10688,6 @@ Object {
"id6": true,
"id7": true,
"id8": true,
- "id9": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -7369,13 +10701,13 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -7385,15 +10717,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 13,
- "versionNonce": 1898319239,
- "width": 5,
- "x": 15,
+ "version": 10,
+ "versionNonce": 747212839,
+ "width": 10,
+ "x": 10,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -7722,141 +11054,15 @@ Object {
},
],
},
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
- "width": 15,
- "x": 5,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 13,
- "versionNonce": 1898319239,
- "width": 5,
- "x": 15,
- "y": 10,
- },
- ],
- },
],
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] number of renders 1`] = `39`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] number of renders 1`] = `30`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -7899,9 +11105,6 @@ Object {
"id4": true,
"id5": true,
"id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -7915,13 +11118,13 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -7931,15 +11134,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
- "width": 15,
- "x": 5,
+ "version": 8,
+ "versionNonce": 23633383,
+ "width": 10,
+ "x": 10,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -8004,113 +11207,8 @@ Object {
"version": 3,
"versionNonce": 453191,
"width": 15,
- "x": 5,
- "y": 5,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 5,
- "versionNonce": 1116226695,
- "width": 5,
- "x": 15,
- "y": 15,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 6,
- "versionNonce": 238820263,
- "width": 10,
- "x": 10,
- "y": 10,
+ "x": 5,
+ "y": 5,
},
],
},
@@ -8121,9 +11219,6 @@ Object {
"id0": true,
"id1": true,
"id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8133,7 +11228,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -8143,11 +11238,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 7,
- "versionNonce": 1604849351,
- "width": 5,
+ "version": 4,
+ "versionNonce": 2019559783,
+ "width": 10,
"x": 10,
- "y": 5,
+ "y": 10,
},
],
},
@@ -8159,9 +11254,6 @@ Object {
"id1": true,
"id2": true,
"id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8171,7 +11263,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -8181,11 +11273,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 8,
- "versionNonce": 23633383,
- "width": 10,
- "x": 10,
- "y": 10,
+ "version": 5,
+ "versionNonce": 1116226695,
+ "width": 5,
+ "x": 15,
+ "y": 15,
},
],
},
@@ -8198,9 +11290,6 @@ Object {
"id2": true,
"id3": true,
"id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8210,7 +11299,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -8220,11 +11309,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 9,
- "versionNonce": 915032327,
- "width": 15,
+ "version": 6,
+ "versionNonce": 238820263,
+ "width": 10,
"x": 10,
- "y": 15,
+ "y": 10,
},
],
},
@@ -8238,9 +11327,6 @@ Object {
"id3": true,
"id4": true,
"id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8250,7 +11336,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -8260,11 +11346,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
- "width": 10,
+ "version": 7,
+ "versionNonce": 1604849351,
+ "width": 5,
"x": 10,
- "y": 10,
+ "y": 5,
},
],
},
@@ -8279,9 +11365,6 @@ Object {
"id4": true,
"id5": true,
"id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8291,7 +11374,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -8301,10 +11384,10 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
- "width": 15,
- "x": 5,
+ "version": 8,
+ "versionNonce": 23633383,
+ "width": 10,
+ "x": 10,
"y": 10,
},
],
@@ -8313,11 +11396,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] number of renders 1`] = `33`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] number of renders 1`] = `24`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -8358,10 +11441,6 @@ Object {
"id2": true,
"id3": true,
"id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -8375,7 +11454,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -8391,15 +11470,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
+ "version": 6,
+ "versionNonce": 238820263,
"width": 10,
"x": 10,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -8574,54 +11653,100 @@ Object {
},
],
},
+ ],
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] number of elements 1`] = `1`;
+
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] number of renders 1`] = `18`;
+
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": null,
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Untitled-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
+ "scrollX": 0,
+ "scrollY": 0,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ },
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] element 0 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 7,
- "versionNonce": 1604849351,
- "width": 5,
- "x": 10,
- "y": 5,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8641,8 +11766,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 8,
- "versionNonce": 23633383,
+ "version": 2,
+ "versionNonce": 1278240551,
"width": 10,
"x": 10,
"y": 10,
@@ -8655,12 +11780,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8670,7 +11789,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -8680,11 +11799,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 9,
- "versionNonce": 915032327,
+ "version": 3,
+ "versionNonce": 453191,
"width": 15,
- "x": 10,
- "y": 15,
+ "x": 5,
+ "y": 5,
},
],
},
@@ -8695,12 +11814,6 @@ Object {
"id0": true,
"id1": true,
"id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -8720,8 +11833,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
+ "version": 4,
+ "versionNonce": 2019559783,
"width": 10,
"x": 10,
"y": 10,
@@ -8732,11 +11845,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] number of renders 1`] = `30`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] number of renders 1`] = `12`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -8774,11 +11887,21 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
+ "id16": true,
"id2": true,
"id3": true,
"id4": true,
"id5": true,
"id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -8792,7 +11915,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -8808,15 +11931,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 8,
- "versionNonce": 23633383,
+ "version": 18,
+ "versionNonce": 845789479,
"width": 10,
"x": 10,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -9066,102 +12189,58 @@ Object {
},
],
},
- ],
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] number of elements 1`] = `1`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] number of renders 1`] = `24`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 6,
- "versionNonce": 238820263,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 5,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 9,
+ "versionNonce": 915032327,
+ "width": 15,
+ "x": 10,
+ "y": 15,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9181,8 +12260,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 10,
+ "versionNonce": 747212839,
"width": 10,
"x": 10,
"y": 10,
@@ -9195,6 +12274,14 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9204,7 +12291,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -9214,11 +12301,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 3,
- "versionNonce": 453191,
+ "version": 11,
+ "versionNonce": 760410951,
"width": 15,
"x": 5,
- "y": 5,
+ "y": 10,
},
],
},
@@ -9228,7 +12315,15 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
"id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9248,8 +12343,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
+ "version": 12,
+ "versionNonce": 289600103,
"width": 10,
"x": 10,
"y": 10,
@@ -9262,8 +12357,16 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
"id2": true,
"id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9273,7 +12376,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -9283,11 +12386,55 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 5,
- "versionNonce": 1116226695,
+ "version": 13,
+ "versionNonce": 1898319239,
"width": 5,
"x": 15,
- "y": 15,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Untitled-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 14,
+ "versionNonce": 406373543,
+ "width": 10,
+ "x": 10,
+ "y": 10,
},
],
},
@@ -9297,9 +12444,18 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
"id2": true,
"id3": true,
"id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9309,7 +12465,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 10,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -9319,108 +12475,33 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 6,
- "versionNonce": 238820263,
- "width": 10,
+ "version": 15,
+ "versionNonce": 908564423,
+ "width": 5,
"x": 10,
"y": 10,
},
],
},
- ],
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] number of elements 1`] = `1`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] number of renders 1`] = `18`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 0,
- "scrollY": 0,
- "scrolledOutside": false,
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- },
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] element 0 1`] = `
-Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
+ "id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9440,8 +12521,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
+ "version": 16,
+ "versionNonce": 1359939303,
"width": 10,
"x": 10,
"y": 10,
@@ -9454,6 +12535,20 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
+ "id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9473,11 +12568,11 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 3,
- "versionNonce": 453191,
+ "version": 17,
+ "versionNonce": 2004587015,
"width": 15,
- "x": 5,
- "y": 5,
+ "x": 10,
+ "y": 10,
},
],
},
@@ -9487,7 +12582,21 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
+ "id10": true,
+ "id11": true,
+ "id12": true,
+ "id13": true,
+ "id14": true,
+ "id15": true,
+ "id16": true,
"id2": true,
+ "id3": true,
+ "id4": true,
+ "id5": true,
+ "id6": true,
+ "id7": true,
+ "id8": true,
+ "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -9507,8 +12616,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
+ "version": 18,
+ "versionNonce": 845789479,
"width": 10,
"x": 10,
"y": 10,
@@ -9519,11 +12628,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] number of renders 1`] = `12`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] number of renders 1`] = `54`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -9566,8 +12675,6 @@ Object {
"id12": true,
"id13": true,
"id14": true,
- "id15": true,
- "id16": true,
"id2": true,
"id3": true,
"id4": true,
@@ -9589,7 +12696,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -9605,15 +12712,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 18,
- "versionNonce": 845789479,
+ "version": 16,
+ "versionNonce": 1359939303,
"width": 10,
"x": 10,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -9934,91 +13041,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
- "width": 15,
- "x": 5,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
+ "version": 10,
+ "versionNonce": 747212839,
"width": 10,
"x": 10,
"y": 10,
@@ -10031,8 +13055,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
"id2": true,
"id3": true,
"id4": true,
@@ -10050,7 +13072,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -10060,10 +13082,10 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 13,
- "versionNonce": 1898319239,
- "width": 5,
- "x": 15,
+ "version": 11,
+ "versionNonce": 760410951,
+ "width": 15,
+ "x": 5,
"y": 10,
},
],
@@ -10075,8 +13097,6 @@ Object {
"id0": true,
"id1": true,
"id10": true,
- "id11": true,
- "id12": true,
"id2": true,
"id3": true,
"id4": true,
@@ -10104,8 +13124,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 14,
- "versionNonce": 406373543,
+ "version": 12,
+ "versionNonce": 289600103,
"width": 10,
"x": 10,
"y": 10,
@@ -10120,8 +13140,6 @@ Object {
"id1": true,
"id10": true,
"id11": true,
- "id12": true,
- "id13": true,
"id2": true,
"id3": true,
"id4": true,
@@ -10139,7 +13157,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 15,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -10149,10 +13167,10 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 15,
- "versionNonce": 908564423,
+ "version": 13,
+ "versionNonce": 1898319239,
"width": 5,
- "x": 10,
+ "x": 15,
"y": 10,
},
],
@@ -10166,8 +13184,6 @@ Object {
"id10": true,
"id11": true,
"id12": true,
- "id13": true,
- "id14": true,
"id2": true,
"id3": true,
"id4": true,
@@ -10195,8 +13211,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 16,
- "versionNonce": 1359939303,
+ "version": 14,
+ "versionNonce": 406373543,
"width": 10,
"x": 10,
"y": 10,
@@ -10213,8 +13229,6 @@ Object {
"id11": true,
"id12": true,
"id13": true,
- "id14": true,
- "id15": true,
"id2": true,
"id3": true,
"id4": true,
@@ -10232,7 +13246,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -10242,9 +13256,9 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 17,
- "versionNonce": 2004587015,
- "width": 15,
+ "version": 15,
+ "versionNonce": 908564423,
+ "width": 5,
"x": 10,
"y": 10,
},
@@ -10261,8 +13275,6 @@ Object {
"id12": true,
"id13": true,
"id14": true,
- "id15": true,
- "id16": true,
"id2": true,
"id3": true,
"id4": true,
@@ -10290,8 +13302,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 18,
- "versionNonce": 845789479,
+ "version": 16,
+ "versionNonce": 1359939303,
"width": 10,
"x": 10,
"y": 10,
@@ -10302,11 +13314,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] number of renders 1`] = `54`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] number of renders 1`] = `48`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -10347,8 +13359,6 @@ Object {
"id10": true,
"id11": true,
"id12": true,
- "id13": true,
- "id14": true,
"id2": true,
"id3": true,
"id4": true,
@@ -10370,7 +13380,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -10386,15 +13396,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 16,
- "versionNonce": 1359939303,
+ "version": 14,
+ "versionNonce": 406373543,
"width": 10,
"x": 10,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -10893,106 +13903,15 @@ Object {
},
],
},
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 15,
- "versionNonce": 908564423,
- "width": 5,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id11": true,
- "id12": true,
- "id13": true,
- "id14": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 16,
- "versionNonce": 1359939303,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
],
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] number of renders 1`] = `48`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] number of renders 1`] = `42`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] appState 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -11031,8 +13950,6 @@ Object {
"id0": true,
"id1": true,
"id10": true,
- "id11": true,
- "id12": true,
"id2": true,
"id3": true,
"id4": true,
@@ -11054,7 +13971,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] element 0 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -11070,15 +13987,15 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 14,
- "versionNonce": 406373543,
+ "version": 12,
+ "versionNonce": 289600103,
"width": 10,
"x": 10,
"y": 10,
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] history 1`] = `
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
@@ -11399,91 +14316,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
- "width": 15,
- "x": 5,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
+ "version": 10,
+ "versionNonce": 747212839,
"width": 10,
"x": 10,
"y": 10,
@@ -11496,8 +14330,6 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
- "id11": true,
"id2": true,
"id3": true,
"id4": true,
@@ -11515,7 +14347,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 15,
+ "height": 5,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -11525,10 +14357,10 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 13,
- "versionNonce": 1898319239,
- "width": 5,
- "x": 15,
+ "version": 11,
+ "versionNonce": 760410951,
+ "width": 15,
+ "x": 5,
"y": 10,
},
],
@@ -11540,8 +14372,6 @@ Object {
"id0": true,
"id1": true,
"id10": true,
- "id11": true,
- "id12": true,
"id2": true,
"id3": true,
"id4": true,
@@ -11569,8 +14399,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 14,
- "versionNonce": 406373543,
+ "version": 12,
+ "versionNonce": 289600103,
"width": 10,
"x": 10,
"y": 10,
@@ -11581,11 +14411,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] number of elements 1`] = `1`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] number of elements 1`] = `1`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] number of renders 1`] = `42`;
+exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] number of renders 1`] = `36`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] appState 1`] = `
+exports[`regression tests shift-click to multiselect, then drag: [end of test] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -11623,15 +14453,9 @@ Object {
"selectedElementIds": Object {
"id0": true,
"id1": true,
- "id10": true,
"id2": true,
"id3": true,
"id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -11645,7 +14469,7 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] element 0 1`] = `
+exports[`regression tests shift-click to multiselect, then drag: [end of test] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
@@ -11661,237 +14485,48 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
- "width": 10,
- "x": 10,
- "y": 10,
-}
-`;
-
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 2,
- "versionNonce": 1278240551,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 3,
- "versionNonce": 453191,
- "width": 15,
- "x": 5,
- "y": 5,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 4,
- "versionNonce": 2019559783,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 5,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 5,
- "versionNonce": 1116226695,
- "width": 5,
- "x": 15,
- "y": 15,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 10,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 6,
- "versionNonce": 238820263,
- "width": 10,
- "x": 10,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- },
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
- Object {
- "angle": 0,
- "backgroundColor": "transparent",
- "fillStyle": "hachure",
- "groupIds": Array [],
- "height": 15,
- "id": "id0",
- "isDeleted": false,
- "opacity": 100,
- "roughness": 1,
- "seed": 337897,
- "strokeColor": "#000000",
- "strokeStyle": "solid",
- "strokeWidth": 1,
- "type": "rectangle",
- "version": 7,
- "versionNonce": 1604849351,
- "width": 5,
- "x": 10,
- "y": 5,
- },
- ],
- },
+ "version": 3,
+ "versionNonce": 1116226695,
+ "width": 10,
+ "x": 20,
+ "y": 20,
+}
+`;
+
+exports[`regression tests shift-click to multiselect, then drag: [end of test] element 1 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 1014066025,
+ "width": 10,
+ "x": 40,
+ "y": 20,
+}
+`;
+
+exports[`regression tests shift-click to multiselect, then drag: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [
Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
"id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -11911,8 +14546,8 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 8,
- "versionNonce": 23633383,
+ "version": 2,
+ "versionNonce": 1278240551,
"width": 10,
"x": 10,
"y": 10,
@@ -11923,14 +14558,7 @@ Object {
"appState": Object {
"name": "Untitled-201933152653",
"selectedElementIds": Object {
- "id0": true,
"id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -11940,7 +14568,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -11950,50 +14578,31 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 9,
- "versionNonce": 915032327,
- "width": 15,
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
"x": 10,
- "y": 15,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
+ "y": 10,
},
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
"height": 10,
- "id": "id0",
+ "id": "id1",
"isDeleted": false,
"opacity": 100,
"roughness": 1,
- "seed": 337897,
+ "seed": 449462985,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 10,
- "versionNonce": 747212839,
+ "version": 2,
+ "versionNonce": 453191,
"width": 10,
- "x": 10,
+ "x": 30,
"y": 10,
},
],
@@ -12007,11 +14616,6 @@ Object {
"id2": true,
"id3": true,
"id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -12021,7 +14625,7 @@ Object {
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
- "height": 5,
+ "height": 10,
"id": "id0",
"isDeleted": false,
"opacity": 100,
@@ -12031,53 +14635,32 @@ Object {
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 11,
- "versionNonce": 760410951,
- "width": 15,
- "x": 5,
- "y": 10,
- },
- ],
- },
- Object {
- "appState": Object {
- "name": "Untitled-201933152653",
- "selectedElementIds": Object {
- "id0": true,
- "id1": true,
- "id10": true,
- "id2": true,
- "id3": true,
- "id4": true,
- "id5": true,
- "id6": true,
- "id7": true,
- "id8": true,
- "id9": true,
+ "version": 3,
+ "versionNonce": 1116226695,
+ "width": 10,
+ "x": 20,
+ "y": 20,
},
- "viewBackgroundColor": "#ffffff",
- },
- "elements": Array [
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
"groupIds": Array [],
"height": 10,
- "id": "id0",
+ "id": "id1",
"isDeleted": false,
"opacity": 100,
"roughness": 1,
- "seed": 337897,
+ "seed": 449462985,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 12,
- "versionNonce": 289600103,
+ "version": 3,
+ "versionNonce": 1014066025,
"width": 10,
- "x": 10,
- "y": 10,
+ "x": 40,
+ "y": 20,
},
],
},
@@ -12085,11 +14668,11 @@ Object {
}
`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] number of elements 1`] = `1`;
+exports[`regression tests shift-click to multiselect, then drag: [end of test] number of elements 1`] = `2`;
-exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] number of renders 1`] = `36`;
+exports[`regression tests shift-click to multiselect, then drag: [end of test] number of renders 1`] = `17`;
-exports[`regression tests shift-click to select a group, then drag: [end of test] appState 1`] = `
+exports[`regression tests spacebar + drag scrolls the canvas: [end of test] appState 1`] = `
Object {
"collaborators": Map {},
"currentItemBackgroundColor": "transparent",
@@ -12121,15 +14704,71 @@ Object {
"name": "Untitled-201933152653",
"openMenu": null,
"resizingElement": null,
+ "scrollX": 60,
+ "scrollY": 60,
+ "scrolledOutside": false,
+ "selectedElementIds": Object {},
+ "selectedGroupIds": Object {},
+ "selectionElement": null,
+ "shouldAddWatermark": false,
+ "shouldCacheIgnoreZoom": false,
+ "showShortcutsDialog": false,
+ "username": "",
+ "viewBackgroundColor": "#ffffff",
+ "zenModeEnabled": false,
+ "zoom": 1,
+}
+`;
+
+exports[`regression tests spacebar + drag scrolls the canvas: [end of test] history 1`] = `
+Object {
+ "recording": false,
+ "redoStack": Array [],
+ "stateHistory": Array [],
+}
+`;
+
+exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of elements 1`] = `0`;
+
+exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `5`;
+
+exports[`regression tests supports nested groups: [end of test] appState 1`] = `
+Object {
+ "collaborators": Map {},
+ "currentItemBackgroundColor": "transparent",
+ "currentItemFillStyle": "hachure",
+ "currentItemFontFamily": 1,
+ "currentItemFontSize": 20,
+ "currentItemOpacity": 100,
+ "currentItemRoughness": 1,
+ "currentItemStrokeColor": "#000000",
+ "currentItemStrokeStyle": "solid",
+ "currentItemStrokeWidth": 1,
+ "currentItemTextAlign": "left",
+ "cursorButton": "up",
+ "cursorX": 0,
+ "cursorY": 0,
+ "draggingElement": null,
+ "editingElement": null,
+ "editingGroupId": "id3",
+ "elementLocked": false,
+ "elementType": "selection",
+ "errorMessage": null,
+ "exportBackground": true,
+ "isCollaborating": false,
+ "isLoading": false,
+ "isResizing": false,
+ "isRotating": false,
+ "lastPointerDownWith": "mouse",
+ "multiElement": null,
+ "name": "Unbenannt-201933152653",
+ "openMenu": null,
+ "resizingElement": null,
"scrollX": 0,
"scrollY": 0,
"scrolledOutside": false,
"selectedElementIds": Object {
- "id0": true,
"id1": true,
- "id2": true,
- "id3": true,
- "id4": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -12143,18 +14782,20 @@ Object {
}
`;
-exports[`regression tests shift-click to select a group, then drag: [end of test] element 0 1`] = `
+exports[`regression tests supports nested groups: [end of test] element 0 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
- "id": "id0",
+ "id": "id1",
"isDeleted": false,
"opacity": 100,
"roughness": 1,
- "seed": 337897,
+ "seed": 449462985,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
@@ -12162,45 +14803,107 @@ Object {
"version": 3,
"versionNonce": 1116226695,
"width": 10,
- "x": 20,
- "y": 20,
+ "x": 30,
+ "y": 10,
}
`;
-exports[`regression tests shift-click to select a group, then drag: [end of test] element 1 1`] = `
+exports[`regression tests supports nested groups: [end of test] element 1 1`] = `
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id5",
+ "id3",
+ ],
"height": 10,
- "id": "id1",
+ "id": "id0",
"isDeleted": false,
"opacity": 100,
"roughness": 1,
- "seed": 449462985,
+ "seed": 337897,
"strokeColor": "#000000",
"strokeStyle": "solid",
"strokeWidth": 1,
"type": "rectangle",
- "version": 3,
- "versionNonce": 1014066025,
+ "version": 4,
+ "versionNonce": 400692809,
"width": 10,
- "x": 40,
- "y": 20,
+ "x": 10,
+ "y": 10,
+}
+`;
+
+exports[`regression tests supports nested groups: [end of test] element 2 1`] = `
+Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id5",
+ "id3",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 50,
+ "y": 10,
}
`;
-exports[`regression tests shift-click to select a group, then drag: [end of test] history 1`] = `
+exports[`regression tests supports nested groups: [end of test] history 1`] = `
Object {
"recording": false,
"redoStack": Array [],
"stateHistory": Array [
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 1278240551,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
- "id0": true,
+ "id1": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -12226,13 +14929,34 @@ Object {
"x": 10,
"y": 10,
},
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 453191,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
],
},
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
- "id1": true,
+ "id2": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -12279,17 +15003,36 @@ Object {
"x": 30,
"y": 10,
},
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 2,
+ "versionNonce": 2019559783,
+ "width": 10,
+ "x": 50,
+ "y": 10,
+ },
],
},
Object {
"appState": Object {
- "name": "Untitled-201933152653",
+ "name": "Unbenannt-201933152653",
"selectedElementIds": Object {
"id0": true,
"id1": true,
"id2": true,
- "id3": true,
- "id4": true,
},
"viewBackgroundColor": "#ffffff",
},
@@ -12298,7 +15041,9 @@ Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id0",
"isDeleted": false,
@@ -12310,16 +15055,18 @@ Object {
"strokeWidth": 1,
"type": "rectangle",
"version": 3,
- "versionNonce": 1116226695,
+ "versionNonce": 1150084233,
"width": 10,
- "x": 20,
- "y": 20,
+ "x": 10,
+ "y": 10,
},
Object {
"angle": 0,
"backgroundColor": "transparent",
"fillStyle": "hachure",
- "groupIds": Array [],
+ "groupIds": Array [
+ "id3",
+ ],
"height": 10,
"id": "id1",
"isDeleted": false,
@@ -12331,10 +15078,117 @@ Object {
"strokeWidth": 1,
"type": "rectangle",
"version": 3,
+ "versionNonce": 1116226695,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id3",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
"versionNonce": 1014066025,
"width": 10,
- "x": 40,
- "y": 20,
+ "x": 50,
+ "y": 10,
+ },
+ ],
+ },
+ Object {
+ "appState": Object {
+ "name": "Unbenannt-201933152653",
+ "selectedElementIds": Object {
+ "id0": true,
+ "id2": true,
+ "id4": true,
+ },
+ "viewBackgroundColor": "#ffffff",
+ },
+ "elements": Array [
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id3",
+ ],
+ "height": 10,
+ "id": "id1",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 449462985,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 3,
+ "versionNonce": 1116226695,
+ "width": 10,
+ "x": 30,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id5",
+ "id3",
+ ],
+ "height": 10,
+ "id": "id0",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 337897,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 400692809,
+ "width": 10,
+ "x": 10,
+ "y": 10,
+ },
+ Object {
+ "angle": 0,
+ "backgroundColor": "transparent",
+ "fillStyle": "hachure",
+ "groupIds": Array [
+ "id5",
+ "id3",
+ ],
+ "height": 10,
+ "id": "id2",
+ "isDeleted": false,
+ "opacity": 100,
+ "roughness": 1,
+ "seed": 401146281,
+ "strokeColor": "#000000",
+ "strokeStyle": "solid",
+ "strokeWidth": 1,
+ "type": "rectangle",
+ "version": 4,
+ "versionNonce": 1604849351,
+ "width": 10,
+ "x": 50,
+ "y": 10,
},
],
},
@@ -12342,69 +15196,9 @@ Object {
}
`;
-exports[`regression tests shift-click to select a group, then drag: [end of test] number of elements 1`] = `2`;
-
-exports[`regression tests shift-click to select a group, then drag: [end of test] number of renders 1`] = `17`;
-
-exports[`regression tests spacebar + drag scrolls the canvas: [end of test] appState 1`] = `
-Object {
- "collaborators": Map {},
- "currentItemBackgroundColor": "transparent",
- "currentItemFillStyle": "hachure",
- "currentItemFontFamily": 1,
- "currentItemFontSize": 20,
- "currentItemOpacity": 100,
- "currentItemRoughness": 1,
- "currentItemStrokeColor": "#000000",
- "currentItemStrokeStyle": "solid",
- "currentItemStrokeWidth": 1,
- "currentItemTextAlign": "left",
- "cursorButton": "up",
- "cursorX": 0,
- "cursorY": 0,
- "draggingElement": null,
- "editingElement": null,
- "editingGroupId": null,
- "elementLocked": false,
- "elementType": "selection",
- "errorMessage": null,
- "exportBackground": true,
- "isCollaborating": false,
- "isLoading": false,
- "isResizing": false,
- "isRotating": false,
- "lastPointerDownWith": "mouse",
- "multiElement": null,
- "name": "Untitled-201933152653",
- "openMenu": null,
- "resizingElement": null,
- "scrollX": 10,
- "scrollY": 10,
- "scrolledOutside": false,
- "selectedElementIds": Object {},
- "selectedGroupIds": Object {},
- "selectionElement": null,
- "shouldAddWatermark": false,
- "shouldCacheIgnoreZoom": false,
- "showShortcutsDialog": false,
- "username": "",
- "viewBackgroundColor": "#ffffff",
- "zenModeEnabled": false,
- "zoom": 1,
-}
-`;
-
-exports[`regression tests spacebar + drag scrolls the canvas: [end of test] history 1`] = `
-Object {
- "recording": false,
- "redoStack": Array [],
- "stateHistory": Array [],
-}
-`;
-
-exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of elements 1`] = `0`;
+exports[`regression tests supports nested groups: [end of test] number of elements 1`] = `3`;
-exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `5`;
+exports[`regression tests supports nested groups: [end of test] number of renders 1`] = `30`;
exports[`regression tests two-finger scroll works: [end of test] appState 1`] = `
Object {
@@ -12433,16 +15227,16 @@ Object {
"isLoading": false,
"isResizing": false,
"isRotating": false,
- "lastPointerDownWith": "mouse",
+ "lastPointerDownWith": "touch",
"multiElement": null,
"name": "Untitled-201933152653",
"openMenu": null,
"resizingElement": null,
- "scrollX": 8,
- "scrollY": -9,
+ "scrollX": 11,
+ "scrollY": -5,
"scrolledOutside": false,
"selectedElementIds": Object {
- "id1": true,
+ "id0": true,
},
"selectedGroupIds": Object {},
"selectionElement": null,
@@ -12452,7 +15246,7 @@ Object {
"username": "",
"viewBackgroundColor": "#ffffff",
"zenModeEnabled": false,
- "zoom": 1,
+ "zoom": 1.99,
}
`;
@@ -12599,8 +15393,8 @@ Object {
"version": 11,
"versionNonce": 1315507081,
"width": 10,
- "x": 10,
- "y": 30,
+ "x": 50,
+ "y": 10,
}
`;
@@ -12695,8 +15489,8 @@ Object {
"version": 7,
"versionNonce": 400692809,
"width": 10,
- "x": 10,
- "y": 30,
+ "x": 50,
+ "y": 10,
},
],
},
@@ -12783,8 +15577,8 @@ Object {
"version": 5,
"versionNonce": 1014066025,
"width": 10,
- "x": 10,
- "y": 30,
+ "x": 50,
+ "y": 10,
},
],
},
diff --git a/src/tests/regressionTests.test.tsx b/src/tests/regressionTests.test.tsx
index eb6d4ea7a4..bad6ac1ac9 100644
--- a/src/tests/regressionTests.test.tsx
+++ b/src/tests/regressionTests.test.tsx
@@ -20,111 +20,66 @@ const clickTool = (toolName: ToolName) => {
fireEvent.click(getByToolName(toolName));
};
-let lastClientX = 0;
-let lastClientY = 0;
-let pointerType: "mouse" | "pen" | "touch" = "mouse";
-
-const pointerDown = (
- clientX: number = lastClientX,
- clientY: number = lastClientY,
- altKey: boolean = false,
- shiftKey: boolean = false,
-) => {
- lastClientX = clientX;
- lastClientY = clientY;
- fireEvent.pointerDown(canvas, {
- clientX,
- clientY,
- altKey,
- shiftKey,
- pointerId: 1,
- pointerType,
- });
-};
-
-const pointer2Down = (clientX: number, clientY: number) => {
- fireEvent.pointerDown(canvas, {
- clientX,
- clientY,
- pointerId: 2,
- pointerType,
- });
-};
+let altKey = false;
+let shiftKey = false;
+let ctrlKey = false;
+
+function withModifierKeys(
+ modifiers: { alt?: boolean; shift?: boolean; ctrl?: boolean },
+ cb: () => void,
+) {
+ const prevAltKey = altKey;
+ const prevShiftKey = shiftKey;
+ const prevCtrlKey = ctrlKey;
+
+ altKey = !!modifiers.alt;
+ shiftKey = !!modifiers.shift;
+ ctrlKey = !!modifiers.ctrl;
+
+ try {
+ cb();
+ } finally {
+ altKey = prevAltKey;
+ shiftKey = prevShiftKey;
+ ctrlKey = prevCtrlKey;
+ }
+}
-const pointer2Move = (clientX: number, clientY: number) => {
- fireEvent.pointerMove(canvas, {
- clientX,
- clientY,
- pointerId: 2,
- pointerType,
- });
+const hotkeyDown = (hotkey: Key) => {
+ const key = KEYS[hotkey];
+ if (typeof key !== "string") {
+ throw new Error("must provide a hotkey, not a key code");
+ }
+ keyDown(key);
};
-const pointer2Up = (clientX: number, clientY: number) => {
- fireEvent.pointerUp(canvas, {
- clientX,
- clientY,
- pointerId: 2,
- pointerType,
- });
+const hotkeyUp = (hotkey: Key) => {
+ const key = KEYS[hotkey];
+ if (typeof key !== "string") {
+ throw new Error("must provide a hotkey, not a key code");
+ }
+ keyUp(key);
};
-const pointerMove = (
- clientX: number = lastClientX,
- clientY: number = lastClientY,
- altKey: boolean = false,
- shiftKey: boolean = false,
-) => {
- lastClientX = clientX;
- lastClientY = clientY;
- fireEvent.pointerMove(canvas, {
- clientX,
- clientY,
- altKey,
+const keyDown = (key: string) => {
+ fireEvent.keyDown(document, {
+ key,
+ ctrlKey,
shiftKey,
- pointerId: 1,
- pointerType,
- });
-};
-
-const pointerUp = (
- clientX: number = lastClientX,
- clientY: number = lastClientY,
- altKey: boolean = false,
- shiftKey: boolean = false,
-) => {
- lastClientX = clientX;
- lastClientY = clientY;
- fireEvent.pointerUp(canvas, { pointerId: 1, pointerType, shiftKey, altKey });
-};
-
-const hotkeyDown = (key: Key) => {
- fireEvent.keyDown(document, { key: KEYS[key] });
-};
-
-const hotkeyUp = (key: Key) => {
- fireEvent.keyUp(document, {
- key: KEYS[key],
+ altKey,
+ keyCode: key.toUpperCase().charCodeAt(0),
+ which: key.toUpperCase().charCodeAt(0),
});
};
-const keyDown = (
- key: string,
- ctrlKey: boolean = false,
- shiftKey: boolean = false,
-) => {
- fireEvent.keyDown(document, { key, ctrlKey, shiftKey });
-};
-
-const keyUp = (
- key: string,
- ctrlKey: boolean = false,
- shiftKey: boolean = false,
-) => {
+const keyUp = (key: string) => {
fireEvent.keyUp(document, {
key,
ctrlKey,
shiftKey,
+ altKey,
+ keyCode: key.toUpperCase().charCodeAt(0),
+ which: key.toUpperCase().charCodeAt(0),
});
};
@@ -133,15 +88,80 @@ const hotkeyPress = (key: Key) => {
hotkeyUp(key);
};
-const keyPress = (
- key: string,
- ctrlKey: boolean = false,
- shiftKey: boolean = false,
-) => {
- keyDown(key, ctrlKey, shiftKey);
- keyUp(key, ctrlKey, shiftKey);
+const keyPress = (key: string) => {
+ keyDown(key);
+ keyUp(key);
};
+class Pointer {
+ private clientX = 0;
+ private clientY = 0;
+
+ constructor(
+ private readonly pointerType: "mouse" | "touch" | "pen",
+ private readonly pointerId = 1,
+ ) {}
+
+ reset() {
+ this.clientX = 0;
+ this.clientY = 0;
+ }
+
+ getPosition() {
+ return [this.clientX, this.clientY];
+ }
+
+ restorePosition(x = 0, y = 0) {
+ this.clientX = x;
+ this.clientY = y;
+ fireEvent.pointerMove(canvas, this.getEvent());
+ }
+
+ private getEvent() {
+ return {
+ clientX: this.clientX,
+ clientY: this.clientY,
+ pointerType: this.pointerType,
+ pointerId: this.pointerId,
+ altKey,
+ shiftKey,
+ ctrlKey,
+ };
+ }
+
+ move(dx: number, dy: number) {
+ if (dx !== 0 || dy !== 0) {
+ this.clientX += dx;
+ this.clientY += dy;
+ fireEvent.pointerMove(canvas, this.getEvent());
+ }
+ }
+
+ down(dx = 0, dy = 0) {
+ this.move(dx, dy);
+ fireEvent.pointerDown(canvas, this.getEvent());
+ }
+
+ up(dx = 0, dy = 0) {
+ this.move(dx, dy);
+ fireEvent.pointerUp(canvas, this.getEvent());
+ }
+
+ click(dx = 0, dy = 0) {
+ this.down(dx, dy);
+ this.up();
+ }
+
+ doubleClick(dx = 0, dy = 0) {
+ this.move(dx, dy);
+ fireEvent.doubleClick(canvas, this.getEvent());
+ }
+}
+
+const mouse = new Pointer("mouse");
+const finger1 = new Pointer("touch", 1);
+const finger2 = new Pointer("touch", 2);
+
const clickLabeledElement = (label: string) => {
const element = document.querySelector(`[aria-label='${label}']`);
if (!element) {
@@ -150,10 +170,12 @@ const clickLabeledElement = (label: string) => {
fireEvent.click(element);
};
+const getSelectedElements = (): ExcalidrawElement[] => {
+ return h.elements.filter((element) => h.state.selectedElementIds[element.id]);
+};
+
const getSelectedElement = (): ExcalidrawElement => {
- const selectedElements = h.elements.filter(
- (element) => h.state.selectedElementIds[element.id],
- );
+ const selectedElements = getSelectedElements();
if (selectedElements.length !== 1) {
throw new Error(
`expected 1 selected element; got ${selectedElements.length}`,
@@ -168,7 +190,7 @@ function getStateHistory() {
}
type HandlerRectanglesRet = keyof ReturnType<typeof handlerRectangles>;
-const getResizeHandles = () => {
+const getResizeHandles = (pointerType: "mouse" | "touch" | "pen") => {
const rects = handlerRectangles(
getSelectedElement(),
h.state.zoom,
@@ -214,7 +236,11 @@ beforeEach(() => {
h.history.clear();
reseed(7);
setDateTimeForTests("201933152653");
- pointerType = "mouse";
+
+ mouse.reset();
+ finger1.reset();
+ finger2.reset();
+ altKey = ctrlKey = shiftKey = false;
const renderResult = render(<App />);
@@ -229,68 +255,68 @@ afterEach(() => {
describe("regression tests", () => {
it("draw every type of shape", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
clickTool("diamond");
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
clickTool("ellipse");
- pointerDown(50, 10);
- pointerMove(60, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
clickTool("arrow");
- pointerDown(70, 10);
- pointerMove(80, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
clickTool("line");
- pointerDown(90, 10);
- pointerMove(100, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
clickTool("arrow");
- pointerDown(10, 30);
- pointerUp();
- pointerMove(20, 40);
- pointerUp();
- pointerMove(10, 50);
- pointerUp();
+ mouse.click(10, -10);
+ mouse.click(10, 10);
+ mouse.click(-10, 10);
hotkeyPress("ENTER");
clickTool("line");
- pointerDown(30, 30);
- pointerUp();
- pointerMove(40, 40);
- pointerUp();
- pointerMove(30, 50);
- pointerUp();
+ mouse.click(10, -20);
+ mouse.click(10, 10);
+ mouse.click(-10, 10);
hotkeyPress("ENTER");
clickTool("draw");
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+ mouse.down(10, -20);
+ mouse.up(10, 10);
+
+ expect(h.elements.map((element) => element.type)).toEqual([
+ "rectangle",
+ "diamond",
+ "ellipse",
+ "arrow",
+ "line",
+ "arrow",
+ "line",
+ "draw",
+ ]);
});
it("click to select a shape", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
+
+ const firstRectPos = mouse.getPosition();
clickTool("rectangle");
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
const prevSelectedId = getSelectedElement().id;
- pointerDown(10, 10);
- pointerUp();
+ mouse.restorePosition(...firstRectPos);
+ mouse.click();
+
expect(getSelectedElement().id).not.toEqual(prevSelectedId);
});
@@ -306,9 +332,8 @@ describe("regression tests", () => {
it(`hotkey ${key} selects ${shape} tool`, () => {
keyPress(key);
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
expect(getSelectedElement().type).toBe(shape);
});
@@ -317,9 +342,8 @@ describe("regression tests", () => {
it("change the properties of a shape", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
clickLabeledElement("Background");
clickLabeledElement("#fa5252");
@@ -331,18 +355,18 @@ describe("regression tests", () => {
it("resize an element, trying every resize handle", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
- const resizeHandles = getResizeHandles();
+ const resizeHandles = getResizeHandles("mouse");
delete resizeHandles.rotation; // exclude rotation handle
for (const handlePos in resizeHandles) {
const [x, y] = resizeHandles[handlePos as keyof typeof resizeHandles];
const { width: prevWidth, height: prevHeight } = getSelectedElement();
- pointerDown(x, y);
- pointerMove(x - 5, y - 5);
- pointerUp();
+ mouse.restorePosition(x, y);
+ mouse.down();
+ mouse.up(-5, -5);
+
const {
width: nextWidthNegative,
height: nextHeightNegative,
@@ -352,17 +376,18 @@ describe("regression tests", () => {
).toBeTruthy();
checkpoint(`resize handle ${handlePos} (-5, -5)`);
- pointerDown();
- pointerMove(x, y);
- pointerUp();
+ mouse.down();
+ mouse.up(5, 5);
+
const { width, height } = getSelectedElement();
expect(width).toBe(prevWidth);
expect(height).toBe(prevHeight);
checkpoint(`unresize handle ${handlePos} (-5, -5)`);
- pointerDown(x, y);
- pointerMove(x + 5, y + 5);
- pointerUp();
+ mouse.restorePosition(x, y);
+ mouse.down();
+ mouse.up(5, 5);
+
const {
width: nextWidthPositive,
height: nextHeightPositive,
@@ -372,9 +397,9 @@ describe("regression tests", () => {
).toBeTruthy();
checkpoint(`resize handle ${handlePos} (+5, +5)`);
- pointerDown();
- pointerMove(x, y);
- pointerUp();
+ mouse.down();
+ mouse.up(-5, -5);
+
const { width: finalWidth, height: finalHeight } = getSelectedElement();
expect(finalWidth).toBe(prevWidth);
expect(finalHeight).toBe(prevHeight);
@@ -385,14 +410,12 @@ describe("regression tests", () => {
it("click on an element and drag it", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
const { x: prevX, y: prevY } = getSelectedElement();
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(-10, -10);
+ mouse.up(10, 10);
const { x: nextX, y: nextY } = getSelectedElement();
expect(nextX).toBeGreaterThan(prevX);
@@ -400,9 +423,8 @@ describe("regression tests", () => {
checkpoint("dragged");
- pointerDown();
- pointerMove(10, 10);
- pointerUp();
+ mouse.down();
+ mouse.up(-10, -10);
const { x, y } = getSelectedElement();
expect(x).toBe(prevX);
@@ -411,16 +433,18 @@ describe("regression tests", () => {
it("alt-drag duplicates an element", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
expect(
h.elements.filter((element) => element.type === "rectangle").length,
).toBe(1);
- pointerDown(10, 10, true);
- pointerMove(20, 20, true);
- pointerUp(20, 20, true);
+
+ withModifierKeys({ alt: true }, () => {
+ mouse.down(-10, -10);
+ mouse.up(10, 10);
+ });
+
expect(
h.elements.filter((element) => element.type === "rectangle").length,
).toBe(2);
@@ -428,23 +452,23 @@ describe("regression tests", () => {
it("click-drag to select a group", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
clickTool("rectangle");
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+
+ const finalPosition = mouse.getPosition();
clickTool("rectangle");
- pointerDown(50, 10);
- pointerMove(60, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
- pointerDown(0, 0);
- pointerMove(45, 25);
- pointerUp();
+ mouse.restorePosition(0, 0);
+ mouse.down();
+ mouse.restorePosition(...finalPosition);
+ mouse.up(5, 5);
expect(
h.elements.filter((element) => h.state.selectedElementIds[element.id])
@@ -452,27 +476,28 @@ describe("regression tests", () => {
).toBe(2);
});
- it("shift-click to select a group, then drag", () => {
+ it("shift-click to multiselect, then drag", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
clickTool("rectangle");
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
const prevRectsXY = h.elements
.filter((element) => element.type === "rectangle")
.map((element) => ({ x: element.x, y: element.y }));
- pointerDown(10, 10);
- pointerUp();
- pointerDown(30, 10, false, true);
- pointerUp();
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+
+ mouse.reset();
+ mouse.click(10, 10);
+ withModifierKeys({ shift: true }, () => {
+ mouse.click(20, 0);
+ });
+
+ mouse.down();
+ mouse.up(10, 10);
+
h.elements
.filter((element) => element.type === "rectangle")
.forEach((element, i) => {
@@ -483,46 +508,41 @@ describe("regression tests", () => {
it("pinch-to-zoom works", () => {
expect(h.state.zoom).toBe(1);
- pointerType = "touch";
- pointerDown(50, 50);
- pointer2Down(60, 50);
- pointerMove(40, 50);
- pointer2Move(60, 50);
+ finger1.down(50, 50);
+ finger2.down(60, 50);
+ finger1.move(-10, 0);
expect(h.state.zoom).toBeGreaterThan(1);
const zoomed = h.state.zoom;
- pointerMove(45, 50);
- pointer2Move(55, 50);
+ finger1.move(5, 0);
+ finger2.move(-5, 0);
expect(h.state.zoom).toBeLessThan(zoomed);
- pointerUp(45, 50);
- pointer2Up(55, 50);
});
it("two-finger scroll works", () => {
const startScrollY = h.state.scrollY;
- pointerDown(50, 50);
- pointer2Down(60, 50);
- pointerMove(50, 40);
- pointer2Move(60, 40);
- pointerUp(50, 40);
- pointer2Up(60, 40);
+ finger1.down(50, 50);
+ finger2.down(60, 50);
+
+ finger1.up(0, -10);
+ finger2.up(0, -10);
expect(h.state.scrollY).toBeLessThan(startScrollY);
const startScrollX = h.state.scrollX;
- pointerDown(50, 50);
- pointer2Down(50, 60);
- pointerMove(60, 50);
- pointer2Move(60, 60);
- pointerUp(60, 50);
- pointer2Up(60, 60);
+
+ finger1.restorePosition(50, 50);
+ finger2.restorePosition(50, 60);
+ finger1.down();
+ finger2.down();
+ finger1.up(10, 0);
+ finger2.up(10, 0);
expect(h.state.scrollX).toBeGreaterThan(startScrollX);
});
it("spacebar + drag scrolls the canvas", () => {
const { scrollX: startScrollX, scrollY: startScrollY } = h.state;
hotkeyDown("SPACE");
- pointerDown(50, 50);
- pointerMove(60, 60);
- pointerUp();
+ mouse.down(50, 50);
+ mouse.up(60, 60);
hotkeyUp("SPACE");
const { scrollX, scrollY } = h.state;
expect(scrollX).not.toEqual(startScrollX);
@@ -531,46 +551,46 @@ describe("regression tests", () => {
it("arrow keys", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
hotkeyPress("ARROW_LEFT");
hotkeyPress("ARROW_LEFT");
hotkeyPress("ARROW_RIGHT");
hotkeyPress("ARROW_UP");
hotkeyPress("ARROW_UP");
hotkeyPress("ARROW_DOWN");
+ expect(h.elements[0].x).toBe(9);
+ expect(h.elements[0].y).toBe(9);
});
it("undo/redo drawing an element", () => {
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
clickTool("rectangle");
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
clickTool("arrow");
- pointerDown(10, 30);
- pointerUp();
- pointerMove(20, 40);
- pointerDown(20, 40);
- pointerUp();
- pointerMove(10, 50);
- pointerDown(10, 50);
- pointerUp();
+ mouse.click(10, -10);
+ mouse.click(10, 10);
+ mouse.click(-10, 10);
hotkeyPress("ENTER");
expect(h.elements.filter((element) => !element.isDeleted).length).toBe(3);
- keyPress("z", true); // press twice for multi arrow
- keyPress("z", true);
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("z");
+ keyPress("z");
+ });
expect(h.elements.filter((element) => !element.isDeleted).length).toBe(2);
- keyPress("z", true);
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("z");
+ });
expect(h.elements.filter((element) => !element.isDeleted).length).toBe(1);
- keyPress("z", true, true);
+ withModifierKeys({ ctrl: true, shift: true }, () => {
+ keyPress("z");
+ });
expect(h.elements.filter((element) => !element.isDeleted).length).toBe(2);
});
@@ -581,37 +601,48 @@ describe("regression tests", () => {
expect(getStateHistory().length).toBe(0);
clickTool("rectangle");
- pointerDown(10, 10);
- pointerMove(20, 20);
- pointerUp();
+ mouse.down(10, 10);
+ mouse.up(10, 10);
+
+ const firstElementEndPoint = mouse.getPosition();
clickTool("rectangle");
- pointerDown(30, 10);
- pointerMove(40, 20);
- pointerUp();
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+
+ const secondElementEndPoint = mouse.getPosition();
expect(getStateHistory().length).toBe(2);
- keyPress("z", true);
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("z");
+ });
+
expect(getStateHistory().length).toBe(1);
- // clicking an element shouldn't addu to history
- pointerDown(10, 10);
- pointerUp();
+ // clicking an element shouldn't add to history
+ mouse.restorePosition(...firstElementEndPoint);
+ mouse.click();
expect(getStateHistory().length).toBe(1);
- keyPress("z", true, true);
+ withModifierKeys({ shift: true, ctrl: true }, () => {
+ keyPress("z");
+ });
+
expect(getStateHistory().length).toBe(2);
- // clicking an element shouldn't addu to history
- pointerDown(10, 10);
- pointerUp();
+ // clicking an element shouldn't add to history
+ mouse.click();
expect(getStateHistory().length).toBe(2);
+ const firstSelectedElementId = getSelectedElement().id;
+
// same for clicking the element just redo-ed
- pointerDown(30, 10);
- pointerUp();
+ mouse.restorePosition(...secondElementEndPoint);
+ mouse.click();
expect(getStateHistory().length).toBe(2);
+
+ expect(getSelectedElement().id).not.toEqual(firstSelectedElementId);
});
it("zoom hotkeys", () => {
@@ -635,4 +666,178 @@ describe("regression tests", () => {
// switching to german, `hachure` label should no longer exist
expect(screen.queryByText(/hachure/i)).toBeNull();
});
+
+ it("make a group and duplicate it", () => {
+ clickTool("rectangle");
+ mouse.down(10, 10);
+ mouse.up(10, 10);
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+ const end = mouse.getPosition();
+
+ mouse.reset();
+ mouse.down();
+ mouse.restorePosition(...end);
+ mouse.up();
+
+ expect(h.elements.length).toBe(3);
+ for (const element of h.elements) {
+ expect(element.groupIds.length).toBe(0);
+ expect(h.state.selectedElementIds[element.id]).toBe(true);
+ }
+
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("g");
+ });
+
+ for (const element of h.elements) {
+ expect(element.groupIds.length).toBe(1);
+ }
+
+ withModifierKeys({ alt: true }, () => {
+ mouse.restorePosition(...end);
+ mouse.down();
+ mouse.up(10, 10);
+ });
+
+ expect(h.elements.length).toBe(6);
+ const groups = new Set();
+ for (const element of h.elements) {
+ for (const groupId of element.groupIds) {
+ groups.add(groupId);
+ }
+ }
+
+ expect(groups.size).toBe(2);
+ });
+
+ it("double click to edit a group", () => {
+ clickTool("rectangle");
+ mouse.down(10, 10);
+ mouse.up(10, 10);
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("a");
+ keyPress("g");
+ });
+
+ expect(getSelectedElements().length).toBe(3);
+ expect(h.state.editingGroupId).toBe(null);
+ mouse.doubleClick();
+ expect(getSelectedElements().length).toBe(1);
+ expect(h.state.editingGroupId).not.toBe(null);
+ });
+
+ it("adjusts z order when grouping", () => {
+ const positions = [];
+
+ clickTool("rectangle");
+ mouse.down(10, 10);
+ mouse.up(10, 10);
+ positions.push(mouse.getPosition());
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+ positions.push(mouse.getPosition());
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+ positions.push(mouse.getPosition());
+
+ const ids = h.elements.map((element) => element.id);
+
+ mouse.restorePosition(...positions[0]);
+ mouse.click();
+ mouse.restorePosition(...positions[2]);
+ withModifierKeys({ shift: true }, () => {
+ mouse.click();
+ });
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("g");
+ });
+
+ expect(h.elements.map((element) => element.id)).toEqual([
+ ids[1],
+ ids[0],
+ ids[2],
+ ]);
+ });
+
+ it("supports nested groups", () => {
+ const positions: number[][] = [];
+
+ clickTool("rectangle");
+ mouse.down(10, 10);
+ mouse.up(10, 10);
+ positions.push(mouse.getPosition());
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+ positions.push(mouse.getPosition());
+
+ clickTool("rectangle");
+ mouse.down(10, -10);
+ mouse.up(10, 10);
+ positions.push(mouse.getPosition());
+
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("a");
+ keyPress("g");
+ });
+
+ mouse.doubleClick();
+ withModifierKeys({ shift: true }, () => {
+ mouse.restorePosition(...positions[0]);
+ mouse.click();
+ });
+ withModifierKeys({ ctrl: true }, () => {
+ keyPress("g");
+ });
+
+ const groupIds = h.elements[2].groupIds;
+ expect(groupIds.length).toBe(2);
+ expect(h.elements[1].groupIds).toEqual(groupIds);
+ expect(h.elements[0].groupIds).toEqual(groupIds.slice(1));
+
+ mouse.click(50, 50);
+ expect(getSelectedElements().length).toBe(0);
+ mouse.restorePosition(...positions[0]);
+ mouse.click();
+ expect(getSelectedElements().length).toBe(3);
+ expect(h.state.editingGroupId).toBe(null);
+
+ mouse.doubleClick();
+ expect(getSelectedElements().length).toBe(2);
+ expect(h.state.editingGroupId).toBe(groupIds[1]);
+
+ mouse.doubleClick();
+ expect(getSelectedElements().length).toBe(1);
+ expect(h.state.editingGroupId).toBe(groupIds[0]);
+
+ // click out of the group
+ mouse.restorePosition(...positions[1]);
+ mouse.click();
+ expect(getSelectedElements().length).toBe(0);
+ mouse.click();
+ expect(getSelectedElements().length).toBe(3);
+ mouse.doubleClick();
+ expect(getSelectedElements().length).toBe(1);
+ });
});