From d5b406b055903e35d8f79b3b98b45ae6e2f911f0 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Thu, 9 May 2024 13:38:37 +0530 Subject: [PATCH] path fixes --- packages/utils/src/bbox.ts | 1 - .../tests/__snapshots__/export.test.ts.snap | 102 ++++++++++++++++++ packages/utils/tests/utils.unmocked.test.ts | 2 +- 3 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 packages/utils/tests/__snapshots__/export.test.ts.snap diff --git a/packages/utils/src/bbox.ts b/packages/utils/src/bbox.ts index 0b3df4681..af536f5cd 100644 --- a/packages/utils/src/bbox.ts +++ b/packages/utils/src/bbox.ts @@ -17,7 +17,6 @@ export function crossProduct(a: Point, b: Point) { } export function doBBoxesIntersect(a: Bounds, b: Bounds) { - console.log("HI"); return a[0] <= b[2] && a[2] >= b[0] && a[1] <= b[3] && a[3] >= b[1]; } diff --git a/packages/utils/tests/__snapshots__/export.test.ts.snap b/packages/utils/tests/__snapshots__/export.test.ts.snap new file mode 100644 index 000000000..fdcb71295 --- /dev/null +++ b/packages/utils/tests/__snapshots__/export.test.ts.snap @@ -0,0 +1,102 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`exportToSvg > with default arguments 1`] = ` +{ + "activeEmbeddable": null, + "activeTool": { + "customType": null, + "lastActiveTool": null, + "locked": false, + "type": "selection", + }, + "collaborators": Map {}, + "contextMenu": null, + "currentChartType": "bar", + "currentItemBackgroundColor": "transparent", + "currentItemEndArrowhead": "arrow", + "currentItemFillStyle": "solid", + "currentItemFontFamily": 1, + "currentItemFontSize": 20, + "currentItemOpacity": 100, + "currentItemRoughness": 1, + "currentItemRoundness": "round", + "currentItemStartArrowhead": null, + "currentItemStrokeColor": "#1e1e1e", + "currentItemStrokeStyle": "solid", + "currentItemStrokeWidth": 2, + "currentItemTextAlign": "left", + "cursorButton": "up", + "defaultSidebarDockedPreference": false, + "draggingElement": null, + "editingElement": null, + "editingFrame": null, + "editingGroupId": null, + "editingLinearElement": null, + "elementsToHighlight": null, + "errorMessage": null, + "exportBackground": true, + "exportEmbedScene": false, + "exportPadding": undefined, + "exportScale": 1, + "exportWithDarkMode": false, + "fileHandle": null, + "followedBy": Set {}, + "frameRendering": { + "clip": true, + "enabled": true, + "name": true, + "outline": true, + }, + "frameToHighlight": null, + "gridSize": null, + "isBindingEnabled": true, + "isLoading": false, + "isResizing": false, + "isRotating": false, + "lastPointerDownWith": "mouse", + "multiElement": null, + "name": "name", + "objectsSnapModeEnabled": false, + "openDialog": null, + "openMenu": null, + "openPopup": null, + "openSidebar": null, + "originSnapOffset": { + "x": 0, + "y": 0, + }, + "pasteDialog": { + "data": null, + "shown": false, + }, + "penDetected": false, + "penMode": false, + "pendingImageElementId": null, + "previousSelectedElementIds": {}, + "resizingElement": null, + "scrollX": 0, + "scrollY": 0, + "scrolledOutside": false, + "selectedElementIds": {}, + "selectedElementsAreBeingDragged": false, + "selectedGroupIds": {}, + "selectedLinearElement": null, + "selectionElement": null, + "shouldCacheIgnoreZoom": false, + "showHyperlinkPopup": false, + "showStats": false, + "showWelcomeScreen": false, + "snapLines": [], + "startBoundElement": null, + "suggestedBindings": [], + "theme": "light", + "toast": null, + "userToFollow": null, + "viewBackgroundColor": "#ffffff", + "viewModeEnabled": false, + "zenModeEnabled": false, + "zoom": { + "value": 1, + }, +} +`; diff --git a/packages/utils/tests/utils.unmocked.test.ts b/packages/utils/tests/utils.unmocked.test.ts index 832141110..04cd33e84 100644 --- a/packages/utils/tests/utils.unmocked.test.ts +++ b/packages/utils/tests/utils.unmocked.test.ts @@ -3,7 +3,7 @@ import { decodeSvgMetadata, } from "../../excalidraw/data/image"; import type { ImportedDataState } from "../../excalidraw/data/types"; -import * as utils from "../dist/prod"; +import * as utils from "../index"; import { API } from "../../excalidraw/tests/helpers/api"; // NOTE this test file is using the actual API, unmocked. Hence splitting it