Skip to content

Commit b4bbc45

Browse files
committed
e2e fix
1 parent 7babf26 commit b4bbc45

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

e2e/dashboard.spec.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ const setMonacoValue = async (page: Page, value: unknown) => {
1212
await page.locator('.monaco-editor').waitFor({ state: 'visible' })
1313
await page.locator('.monaco-editor').click()
1414

15-
const monaco = page.getByRole('textbox', { name: 'Editor content' })
15+
const textbox = page.getByRole('textbox', { name: 'Editor content' })
1616

17-
await monaco.press('ControlOrMeta+a')
18-
await page.keyboard.insertText(JSON.stringify(value, null, 2))
17+
await textbox.press('ControlOrMeta+a')
18+
19+
const jsonStr = JSON.stringify(value, null, 2)
20+
await textbox.evaluate((el, text) => {
21+
const dt = new DataTransfer()
22+
dt.setData('text/plain', text)
23+
el.dispatchEvent(new ClipboardEvent('paste', { clipboardData: dt, bubbles: true, cancelable: true }))
24+
}, jsonStr)
1925
}
2026

2127
const trySaveDashboard = async (page: Page) => {

0 commit comments

Comments
 (0)