adjust tests
This commit is contained in:
parent
bec662eaf6
commit
46c6916e1d
@ -418,19 +418,12 @@ describe("element binding", () => {
|
|||||||
expect(arrow.startBinding?.elementId).toBe(rectLeft.id);
|
expect(arrow.startBinding?.elementId).toBe(rectLeft.id);
|
||||||
expect(arrow.endBinding?.elementId).toBe(rectRight.id);
|
expect(arrow.endBinding?.elementId).toBe(rectRight.id);
|
||||||
|
|
||||||
// Drag arrow off of bound rectangle range
|
|
||||||
const handles = getTransformHandles(
|
|
||||||
arrow,
|
|
||||||
h.state.zoom,
|
|
||||||
arrayToMap(h.elements),
|
|
||||||
"mouse",
|
|
||||||
).se!;
|
|
||||||
|
|
||||||
Keyboard.keyDown(KEYS.CTRL_OR_CMD);
|
Keyboard.keyDown(KEYS.CTRL_OR_CMD);
|
||||||
const elX = handles[0] + handles[2] / 2;
|
mouse.downAt(
|
||||||
const elY = handles[1] + handles[3] / 2;
|
arrow.x + arrow.points[arrow.points.length - 1][0],
|
||||||
mouse.downAt(elX, elY);
|
arrow.y + arrow.points[arrow.points.length - 1][1],
|
||||||
mouse.moveTo(300, 400);
|
);
|
||||||
|
mouse.moveTo(300, 300);
|
||||||
mouse.up();
|
mouse.up();
|
||||||
|
|
||||||
expect(arrow.startBinding).not.toBe(null);
|
expect(arrow.startBinding).not.toBe(null);
|
||||||
|
@ -535,7 +535,7 @@ describe("arrow element", () => {
|
|||||||
|
|
||||||
UI.resize([rectangle, arrow], "nw", [300, 350]);
|
UI.resize([rectangle, arrow], "nw", [300, 350]);
|
||||||
|
|
||||||
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(-0.144, 2);
|
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(-0.168, 2);
|
||||||
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.25);
|
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.25);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user