Skip to content

Commit

Permalink
test(test-utils): correct --turbo error overlay lookup (#46901)
Browse files Browse the repository at this point in the history
### Fixing a bug

Minor fix for #46589, forgot to
wrap in evaluate in result fail to ask to browser to lookup overlay in
--turbo tests.

Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
kwonoj and ijjk authored Mar 27, 2023
1 parent 5262594 commit 73491e1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/lib/next-test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,13 +682,15 @@ export async function getRedboxHeader(browser) {
return retry(
() => {
if (shouldRunTurboDevTest()) {
const portal = [].slice
.call(document.querySelectorAll('nextjs-portal'))
.find((p) =>
p.shadowRoot.querySelector('[data-nextjs-turbo-dialog-body]')
)
const root = portal.shadowRoot
return root.querySelector('[data-nextjs-turbo-dialog-body]').innerText
return evaluate(browser, () => {
const portal = [].slice
.call(document.querySelectorAll('nextjs-portal'))
.find((p) =>
p.shadowRoot.querySelector('[data-nextjs-turbo-dialog-body]')
)
const root = portal.shadowRoot
return root.querySelector('[data-nextjs-turbo-dialog-body]').innerText
})
} else {
return evaluate(browser, () => {
const portal = [].slice
Expand Down

0 comments on commit 73491e1

Please sign in to comment.