fix: #8475 Arrow updated on both sides (#8593)

This commit is contained in:
Ritobroto Kalita 2025-03-04 21:54:39 +05:30 committed by GitHub
parent d21c6a1bc6
commit c5d3bb0b6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 77 additions and 38 deletions

View file

@ -1,4 +1,5 @@
import React from "react";
import "../../utils/test-utils";
import { render, fireEvent, act, unmountComponent } from "./test-utils";
import { Excalidraw } from "../index";
import * as StaticScene from "../renderer/staticScene";
@ -121,10 +122,8 @@ describe("move element", () => {
expect(h.state.selectedElementIds[rectB.id]).toBeTruthy();
expect([rectA.x, rectA.y]).toEqual([0, 0]);
expect([rectB.x, rectB.y]).toEqual([201, 2]);
expect([Math.round(arrow.x), Math.round(arrow.y)]).toEqual([110, 50]);
expect([Math.round(arrow.width), Math.round(arrow.height)]).toEqual([
84, 84,
]);
expect([[arrow.x, arrow.y]]).toCloselyEqualPoints([[107.07, 47.07]]);
expect([[arrow.width, arrow.height]]).toCloselyEqualPoints([[86.86, 87.3]]);
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});