fix: keep customData when converting to ExcalidrawElement (#7656)

* feat: keep customData when converting to ExcalidrawElement (#7654)

* docs: add changelog for keeping customData when converting to ExcalidrawElement
This commit is contained in:
YuBin, Hsu
2024-02-08 19:53:10 +08:00
committed by GitHub
parent 0513b647ec
commit def1df2c68
11 changed files with 482 additions and 0 deletions

View File

@@ -822,4 +822,22 @@ describe("Test Transform", () => {
"Duplicate id found for rect-1",
);
});
it("should contains customData if provided", () => {
const rawData = [
{
type: "rectangle",
x: 100,
y: 100,
customData: { createdBy: "user01" },
},
];
const convertedElements = convertToExcalidrawElements(
rawData as ExcalidrawElementSkeleton[],
opts,
);
expect(convertedElements[0].customData).toStrictEqual({
createdBy: "user01",
});
});
});