mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-08 18:17:11 +02:00
14 lines
369 B
TypeScript
14 lines
369 B
TypeScript
import { waitFor } from "@testing-library/dom";
|
|
|
|
export const getTextEditor = async (waitForEditor = true) => {
|
|
const query = () =>
|
|
document.querySelector(
|
|
".excalidraw-textEditorContainer > textarea",
|
|
) as HTMLTextAreaElement;
|
|
if (waitForEditor) {
|
|
await waitFor(() => expect(query()).not.toBe(null));
|
|
return query();
|
|
}
|
|
return query();
|
|
};
|