Skip to content

Commit

Permalink
dbg
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Mar 1, 2023
1 parent 47da0cc commit f7bae98
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions test/lib/next-test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,18 +667,25 @@ export async function hasRedbox(browser, expected = true) {
return false
}

/*const headerDataQuery = shouldRunTurboDevTest()
? '[data-nextjs-turbo-dialog-body]'
: '[data-nextjs-dialog-header]'*/
const headerDataQuery = '[data-nextjs-dialog-header]'

export async function getRedboxHeader(browser) {
require('console').log('', {
t: shouldRunTurboDevTest(),
q: headerDataQuery
})

return retry(
() =>
evaluate(browser, () => {
const query = shouldRunTurboDevTest() ? '[data-nextjs-turbo-dialog-body]' : '[data-nextjs-dialog-header]'
const portal = [].slice
.call(document.querySelectorAll('nextjs-portal'))
.find((p) =>
p.shadowRoot.querySelector(query)
)
.find((p) => p.shadowRoot.querySelector(headerDataQuery))
const root = portal.shadowRoot
return root.querySelector(query).innerText
return root.querySelector(headerDataQuery).innerText
}),
10000,
500,
Expand Down

0 comments on commit f7bae98

Please sign in to comment.