Repository: excalidraw/excalidraw
File: src/element/textWysiwyg.test.tsx (TypeScript)

Code before:
      expect(
        (h.elements[1] as ExcalidrawTextElementWithContainer).verticalAlign,
      ).toBe(VERTICAL_ALIGN.BOTTOM);

      // Attempt to Bind 2nd text using text tool
      UI.clickTool("text");
      mouse.clickAt(
        rectangle.x + rectangle.width / 2,
        rectangle.y + rectangle.height / 2,
      );
      editor = getTextEditor();
      await new Promise((r) => setTimeout(r, 0));
      updateTextEditor(editor, "Excalidraw");
      editor.blur();

      expect(h.elements.length).toBe(3);
      expect(rectangle.boundElements).toStrictEqual([
        { id: h.elements[1].id, type: "text" },
      ]);
      text = h.elements[2] as ExcalidrawTextElementWithContainer;
      expect(text.containerId).toBe(null);
      expect(text.text).toBe("Excalidraw");
    });
  });

  it("should update labeled arrow version", async () => {
    await render(<ExcalidrawApp />);
    const arrow = UI.createElement("arrow", {
      width: 300,
      height: 0,
    });

    mouse.select(arrow);
    Keyboard.keyPress(KEYS.ENTER);
    let editor = getTextEditor();
    await new Promise((r) => setTimeout(r, 0));
    updateTextEditor(editor, "Hello");
    editor.blur();

    const { version } = arrow;

    mouse.select(arrow);
    Keyboard.keyPress(KEYS.ENTER);
    editor = getTextEditor();
    await new Promise((r) => setTimeout(r, 0));
    updateTextEditor(editor, "Hello\nworld!");
    editor.blur();

    expect(arrow.version).toEqual(version + 1);
  });
});

Review comment (suggestion):
```suggestion
  it("should bump the version of labelled arrow when label updated", async () => {
```

reword

Code after:
      expect(
        (h.elements[1] as ExcalidrawTextElementWithContainer).verticalAlign,
      ).toBe(VERTICAL_ALIGN.BOTTOM);

      // Attempt to Bind 2nd text using text tool
      UI.clickTool("text");
      mouse.clickAt(
        rectangle.x + rectangle.width / 2,
        rectangle.y + rectangle.height / 2,
      );
      editor = getTextEditor();
      await new Promise((r) => setTimeout(r, 0));
      updateTextEditor(editor, "Excalidraw");
      editor.blur();

      expect(h.elements.length).toBe(3);
      expect(rectangle.boundElements).toStrictEqual([
        { id: h.elements[1].id, type: "text" },
      ]);
      text = h.elements[2] as ExcalidrawTextElementWithContainer;
      expect(text.containerId).toBe(null);
      expect(text.text).toBe("Excalidraw");
    });
  });

  it("should bump the version of labelled arrow when label updated", async () => {
    await render(<ExcalidrawApp />);
    const arrow = UI.createElement("arrow", {
      width: 300,
      height: 0,
    });

    mouse.select(arrow);
    Keyboard.keyPress(KEYS.ENTER);
    let editor = getTextEditor();
    await new Promise((r) => setTimeout(r, 0));
    updateTextEditor(editor, "Hello");
    editor.blur();

    const { version } = arrow;

    mouse.select(arrow);
    Keyboard.keyPress(KEYS.ENTER);
    editor = getTextEditor();
    await new Promise((r) => setTimeout(r, 0));
    updateTextEditor(editor, "Hello\nworld!");
    editor.blur();

    expect(arrow.version).toEqual(version + 1);
  });
});