Skip to content

Commit

Permalink
merge func
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Feb 11, 2025
1 parent c887c17 commit 2f039a1
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/lib/next-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,10 @@ export function getRedboxHeader(browser: BrowserInterface) {
})
}

function getRedboxFloatingHeaderText(
export async function getRedboxTotalErrorCount(
browser: BrowserInterface
): Promise<string> {
return browser.eval(() => {
): Promise<number> {
const text = await browser.eval(() => {
const portal = [].slice
.call(document.querySelectorAll('nextjs-portal'))
.find((p) =>
Expand All @@ -1011,12 +1011,7 @@ function getRedboxFloatingHeaderText(
return root?.querySelector('[data-nextjs-dialog-header-total-count]')
?.innerText
})
}

export async function getRedboxTotalErrorCount(
browser: BrowserInterface
): Promise<number> {
return parseInt((await getRedboxFloatingHeaderText(browser)) || '-1')
return parseInt(text || '-1')
}

export async function getRedboxSource(browser: BrowserInterface) {
Expand Down

0 comments on commit 2f039a1

Please sign in to comment.