Selaa lähdekoodia

[skip ci] Small updates to tests

Mark Tolmacs 4 kuukautta sitten
vanhempi
commit
f4abdc751e

+ 11 - 0
packages/excalidraw/tests/__snapshots__/linearElementEditor.test.tsx.snap

@@ -44,3 +44,14 @@ exports[`Test Linear Elements > Test bound text element > should resize and posi
 "Online whiteboard
 collaboration made easy"
 `;
+
+exports[`Test Linear Elements > Test bound text element > should wrap the bound text when arrow bound container moves 1`] = `
+"Online whiteboard
+collaboration made easy"
+`;
+
+exports[`Test Linear Elements > Test bound text element > should wrap the bound text when arrow bound container moves 2`] = `
+"Online whiteboard
+collaboration made
+easy"
+`;

+ 2 - 2
packages/excalidraw/tests/linearElementEditor.test.tsx

@@ -1247,7 +1247,7 @@ describe("Test Linear Elements", () => {
       const textElement = h.elements[2] as ExcalidrawTextElementWithContainer;
 
       expect(arrow.endBinding?.elementId).toBe(rect.id);
-      expect(arrow.width).toBe(400);
+      expect(arrow.width).toBeCloseTo(408, 0);
       expect(rect.x).toBe(400);
       expect(rect.y).toBe(0);
       expect(
@@ -1266,7 +1266,7 @@ describe("Test Linear Elements", () => {
       mouse.downAt(rect.x, rect.y);
       mouse.moveTo(200, 0);
       mouse.upAt(200, 0);
-      expect(arrow.width).toBeCloseTo(204, 0);
+      expect(arrow.width).toBeCloseTo(207, 0);
       expect(rect.x).toBe(200);
       expect(rect.y).toBe(0);
       expect(handleBindTextResizeSpy).toHaveBeenCalledWith(