Completely fix code mirror text navigating for tests

This commit is contained in:
49lf
2024-11-25 12:50:09 -05:00
parent 7ee5a1c26b
commit aa81d616cc
3 changed files with 31 additions and 3 deletions

View File

@ -151,6 +151,17 @@ export async function closePane(page: Page, testId: string) {
async function openKclCodePanel(page: Page) {
await openPane(page, 'code-pane-button')
// Code Mirror lazy loads text! Wowza! Let's force-load the text for tests.
await page.evaluate(() => {
// editorManager is available on the window object.
editorManager._editorView.dispatch({
selection: {
anchor: editorManager._editorView.docView.length
},
scrollIntoView: true,
})
})
}
async function closeKclCodePanel(page: Page) {