Skip to content

Commit

Permalink
Add missing return
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Feb 28, 2024
1 parent 9c896a7 commit b4dc431
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/puppeteer/e2e/mission_side_window.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ describe('Side window', () => {
* Open first control in side window
*/
await mainWindow.waitForXPath("//span[contains(text(), 'Ouvrir le contrôle')]/..")
let buttons = (await mainWindow.$x(
const openControlButtons = (await mainWindow.$x(
"//span[contains(text(), 'Ouvrir le contrôle')]/.."
)) as ElementHandle<HTMLButtonElement>[]
console.log(`Found ${buttons.length} controls`)
console.log(`Found ${openControlButtons.length} controls`)

const firstControlButton = buttons[0]
const firstControlButton = openControlButtons[0]
if (!firstControlButton) {
throw new Error('The first control button is undefined')
}
Expand All @@ -82,10 +82,10 @@ describe('Side window', () => {
*/
await mainWindow.focus('body')
await mainWindow.waitForXPath("//span[contains(text(), 'Ouvrir le contrôle')]/..")
buttons = (await mainWindow.$x(
const openSecondControlButtons = (await mainWindow.$x(
"//span[contains(text(), 'Ouvrir le contrôle')]/.."
)) as ElementHandle<HTMLButtonElement>[]
const secondControlButton = buttons[1]
const secondControlButton = openSecondControlButtons[1]
if (!secondControlButton) {
throw new Error('The second control button is undefined')
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/puppeteer/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ export function listenToConsole(page: Page, index: number) {
console.log(message.args(), message.stackTrace())
if (message.text().includes('/sse')) {
// If the SSE connection fails, the browser will restart it, it is not an application error
return
}

if (message.text().includes('/wfs')) {
// If the SSE connection fails, the browser will restart it, it is not an application error
return
}

throw new Error(message.text())
Expand Down

0 comments on commit b4dc431

Please sign in to comment.