chore(editor): fix imports in legacy tests (#10300)

This commit is contained in:
Saul-Mirone
2025-02-20 03:30:05 +00:00
parent e0b2b2b33c
commit c3fc0a0d88
119 changed files with 96 additions and 90 deletions
@@ -0,0 +1,25 @@
import type { Page } from '@playwright/test';
import { currentEditorIndex } from './multiple-editor.js';
export async function getStringFromRichText(
page: Page,
index = 0
): Promise<string> {
await page.waitForTimeout(50);
return page.evaluate(
([index, currentEditorIndex]) => {
const editorHost =
document.querySelectorAll('editor-host')[currentEditorIndex];
const richTexts = editorHost.querySelectorAll('rich-text');
if (!richTexts) {
throw new Error('Cannot find rich-text');
}
const editor = (richTexts[index] as any).inlineEditor;
return editor.yText.toString();
},
[index, currentEditorIndex]
);
}