Skip to content

Commit

Permalink
Stabilize error-is-clickable test
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jul 28, 2020
1 parent 3405fb9 commit 35d0c2e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/integration/error-is-clickable/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env jest */

import { findPort, killApp, launchApp } from 'next-test-utils'
import { findPort, killApp, launchApp, hasRedbox } from 'next-test-utils'
import webdriver from 'next-webdriver'
import { join } from 'path'

Expand All @@ -21,14 +21,16 @@ describe('Clickable error link', () => {
it('Shows error which is clickable and redirects', async () => {
const browser = await webdriver(appPort, '/first')

await hasRedbox(browser)

await browser.eval(`(function () {
document.querySelector("nextjs-portal")
.shadowRoot
.querySelector("#nextjs__container_errors_desc > a").click()
})()
`)
const url = await browser.url()
document.querySelector("nextjs-portal")
.shadowRoot
.querySelector("#nextjs__container_errors_desc > a").click()
})()
`)

const url = await browser.url()
expect(url).toBe('https://nextjs.org/')
})
})

0 comments on commit 35d0c2e

Please sign in to comment.