test: improve getTextEditor test helper (#9629)

* test: improve getTextEditor test helper

* fix test
This commit is contained in:
David Luzar
2025-06-07 17:45:37 +02:00
committed by GitHub
parent 469caadb87
commit 08cd4c4f9a
10 changed files with 123 additions and 120 deletions
@@ -381,8 +381,7 @@ describe("stats for a non-generic element", () => {
it("text element", async () => {
UI.clickTool("text");
mouse.clickAt(20, 30);
const textEditorSelector = ".excalidraw-textEditorContainer > textarea";
const editor = await getTextEditor(textEditorSelector, true);
const editor = await getTextEditor();
updateTextEditor(editor, "Hello!");
act(() => {
editor.blur();
@@ -575,8 +574,7 @@ describe("stats for multiple elements", () => {
// text, rectangle, frame
UI.clickTool("text");
mouse.clickAt(20, 30);
const textEditorSelector = ".excalidraw-textEditorContainer > textarea";
const editor = await getTextEditor(textEditorSelector, true);
const editor = await getTextEditor();
updateTextEditor(editor, "Hello!");
act(() => {
editor.blur();