Skip to content

Commit

Permalink
thrown error not always caught by test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleydwyer committed Nov 28, 2024
1 parent 97b2bed commit df10a64
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions frontend/console/e2e/cron.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,16 @@ test('submit cron form using ⌘+⏎ shortcut', async ({ page }) => {
await page.keyboard.press('ControlOrMeta+Enter')
const responseEditor = page.locator('#response-editor .cm-content[role="textbox"]')
await expect(responseEditor).toBeVisible()

const responseText = await responseEditor.textContent()
const responseJson = JSON.parse(responseText?.trim() || '{}')

expect(responseJson).toEqual({})
break
} catch (error) {
if (attempt === 2) throw error
}
}

const responseEditor = page.locator('#response-editor .cm-content[role="textbox"]')
await expect(responseEditor).toBeVisible()

const responseText = await responseEditor.textContent()
const responseJson = JSON.parse(responseText?.trim() || '{}')

expect(responseJson).toEqual({})
})

test('submit cron form using ⌘+⏎ shortcut without focusing first', async ({ page }) => {
Expand All @@ -60,17 +57,13 @@ test('submit cron form using ⌘+⏎ shortcut without focusing first', async ({
await page.keyboard.press('ControlOrMeta+Enter')
const responseEditor = page.locator('#response-editor .cm-content[role="textbox"]')
await expect(responseEditor).toBeVisible()
const responseText = await responseEditor.textContent()
const responseJson = JSON.parse(responseText?.trim() || '{}')

expect(responseJson).toEqual({})
break
} catch (error) {
if (attempt === 2) throw error
}
}

const responseEditor = page.locator('#response-editor .cm-content[role="textbox"]')
await expect(responseEditor).toBeVisible()

const responseText = await responseEditor.textContent()
const responseJson = JSON.parse(responseText?.trim() || '{}')

expect(responseJson).toEqual({})
})

0 comments on commit df10a64

Please sign in to comment.