From 6ec259a0e71174651bae95d4628138bf6fd68742 Mon Sep 17 00:00:00 2001 From: kj_sh604 Date: Sun, 15 Mar 2026 16:19:35 -0400 Subject: refactor: packages/ --- .../excalidraw/tests/fixtures/elementFixture.ts | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 packages/excalidraw/tests/fixtures/elementFixture.ts (limited to 'packages/excalidraw/tests/fixtures/elementFixture.ts') diff --git a/packages/excalidraw/tests/fixtures/elementFixture.ts b/packages/excalidraw/tests/fixtures/elementFixture.ts new file mode 100644 index 0000000..f0470ec --- /dev/null +++ b/packages/excalidraw/tests/fixtures/elementFixture.ts @@ -0,0 +1,67 @@ +import type { Radians } from "@excalidraw/math"; +import { DEFAULT_FONT_FAMILY } from "../../constants"; +import type { ExcalidrawElement } from "../../element/types"; + +const elementBase: Omit = { + id: "vWrqOAfkind2qcm7LDAGZ", + x: 414, + y: 237, + width: 214, + height: 214, + angle: 0 as Radians, + strokeColor: "#000000", + backgroundColor: "#15aabf", + fillStyle: "hachure", + strokeWidth: 1, + strokeStyle: "solid", + roughness: 1, + opacity: 100, + groupIds: [], + frameId: null, + roundness: null, + index: null, + seed: 1041657908, + version: 120, + versionNonce: 1188004276, + isDeleted: false, + boundElements: null, + updated: 1, + link: null, + locked: false, +}; + +export const rectangleFixture: ExcalidrawElement = { + ...elementBase, + type: "rectangle", +}; +export const embeddableFixture: ExcalidrawElement = { + ...elementBase, + type: "embeddable", +}; +export const ellipseFixture: ExcalidrawElement = { + ...elementBase, + type: "ellipse", +}; +export const diamondFixture: ExcalidrawElement = { + ...elementBase, + type: "diamond", +}; +export const rectangleWithLinkFixture: ExcalidrawElement = { + ...elementBase, + type: "rectangle", + link: "excalidraw.com", +}; + +export const textFixture: ExcalidrawElement = { + ...elementBase, + type: "text", + fontSize: 20, + fontFamily: DEFAULT_FONT_FAMILY, + text: "original text", + originalText: "original text", + textAlign: "left", + verticalAlign: "top", + containerId: null, + lineHeight: 1.25 as any, + autoResize: false, +}; -- cgit v1.2.3