Fix tests

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs 2025-05-09 22:28:16 +02:00
parent 795a5c16c8
commit d5af9421f0
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View File

@ -172,14 +172,15 @@ describe("element binding", () => {
const arrow = UI.createElement("arrow", {
x: 0,
y: 0,
size: 50,
size: 49,
});
expect(arrow.endBinding).toBe(null);
mouse.downAt(50, 50);
mouse.moveTo(51, 0);
mouse.moveTo(57, 0);
mouse.up(0, 0);
console.log(JSON.stringify(h.elements));
// Test sticky connection
expect(API.getSelectedElement().type).toBe("arrow");

View File

@ -133,10 +133,9 @@ describe("binding with linear elements", () => {
const inputX = UI.queryStatsProperty("X")?.querySelector(
".drag-input",
) as HTMLInputElement;
expect(linear.startBinding).not.toBe(null);
expect(inputX).not.toBeNull();
UI.updateInput(inputX, String("204"));
UI.updateInput(inputX, String("199"));
expect(linear.startBinding).not.toBe(null);
});
@ -657,6 +656,7 @@ describe("stats for multiple elements", () => {
mouse.reset();
Keyboard.withModifierKeys({ shift: true }, () => {
mouse.moveTo(10, 0);
mouse.click();
});