mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
FIx tests
This commit is contained in:
parent
2af0336466
commit
3fa818b0ce
3 changed files with 45 additions and 32 deletions
|
@ -78,8 +78,8 @@ describe("elbow arrow segment move", () => {
|
|||
expect(arrow.points).toCloselyEqualPoints([
|
||||
[0, 0],
|
||||
[110, 0],
|
||||
[110, 195.01],
|
||||
[190, 195.01],
|
||||
[110, 200],
|
||||
[190, 200],
|
||||
]);
|
||||
|
||||
mouse.reset();
|
||||
|
@ -89,8 +89,8 @@ describe("elbow arrow segment move", () => {
|
|||
expect(arrow.points).toCloselyEqualPoints([
|
||||
[0, 0],
|
||||
[110, 0],
|
||||
[110, 195.01],
|
||||
[190, 195.01],
|
||||
[110, 200],
|
||||
[190, 200],
|
||||
]);
|
||||
});
|
||||
|
||||
|
@ -201,8 +201,8 @@ describe("elbow arrow routing", () => {
|
|||
expect(arrow.points).toCloselyEqualPoints([
|
||||
[0, 0],
|
||||
[45, 0],
|
||||
[45, 199.07],
|
||||
[90.07, 199.07],
|
||||
[45, 206.55],
|
||||
[90, 206.55],
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
@ -255,8 +255,8 @@ describe("elbow arrow ui", () => {
|
|||
expect(arrow.points).toCloselyEqualPoints([
|
||||
[0, 0],
|
||||
[45, 0],
|
||||
[45, 195.01],
|
||||
[90, 195.01],
|
||||
[45, 200],
|
||||
[90, 200],
|
||||
]);
|
||||
});
|
||||
|
||||
|
@ -293,11 +293,12 @@ describe("elbow arrow ui", () => {
|
|||
".drag-input",
|
||||
) as HTMLInputElement;
|
||||
UI.updateInput(inputAngle, String("40"));
|
||||
console.log(JSON.stringify(h.elements))
|
||||
|
||||
expect(arrow.points.map((point) => point.map(Math.round))).toEqual([
|
||||
[0, 0],
|
||||
[109, 0],
|
||||
[109, 152],
|
||||
[35, 0],
|
||||
[35, 183],
|
||||
[96, 183],
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
@ -511,12 +511,12 @@ describe("arrow element", () => {
|
|||
)[0] as ExcalidrawElbowArrowElement;
|
||||
|
||||
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.05);
|
||||
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.78);
|
||||
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.79);
|
||||
|
||||
UI.resize(rectangle, "se", [-200, -150]);
|
||||
|
||||
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.05);
|
||||
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.78);
|
||||
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.79);
|
||||
});
|
||||
|
||||
it("flips the fixed point binding on negative resize for group selection", () => {
|
||||
|
@ -539,7 +539,7 @@ describe("arrow element", () => {
|
|||
)[0] as ExcalidrawElbowArrowElement;
|
||||
|
||||
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(1.05);
|
||||
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.78);
|
||||
expect(arrow.startBinding?.fixedPoint?.[1]).toBeCloseTo(0.79);
|
||||
|
||||
UI.resize([rectangle, arrow], "nw", [300, 350]);
|
||||
expect(arrow.startBinding?.fixedPoint?.[0]).toBeCloseTo(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue