(text: string)
| 55 | } |
| 56 | |
| 57 | export async function getElementByText(text: string): Promise<HTMLElement> { |
| 58 | try { |
| 59 | const textElement = await waitFor(() => screen.findByText(text)); |
| 60 | expect(textElement).toBeInTheDocument(); |
| 61 | return textElement; |
| 62 | } catch (e) { |
| 63 | logDomText(); |
| 64 | throw new Error(`Element with text "${text}" not found.`); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | export async function getMainEditor(): Promise<Editor> { |
| 69 | const editorElement = await getElementByTestId("editor-input-main"); |
no test coverage detected