Fix tests

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs 2025-03-06 12:24:48 +01:00
parent 8c9666b8ab
commit 528e6aa2df
5 changed files with 59 additions and 58 deletions

View file

@ -510,13 +510,13 @@ describe("arrow element", () => {
h.state,
)[0] as ExcalidrawElbowArrowElement;
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.05);
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.79);
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.07);
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.86);
UI.resize(rectangle, "se", [-200, -150]);
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.05);
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.79);
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.07);
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.86);
});
it("flips the fixed point binding on negative resize for group selection", () => {
@ -538,8 +538,8 @@ describe("arrow element", () => {
h.state,
)[0] as ExcalidrawElbowArrowElement;
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.05);
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.79);
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.07);
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.86);
UI.resize([rectangle, arrow], "nw", [300, 350]);
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(0);