Skip to content

Commit 2624d41

Browse files
committed
fix: match attr for test
1 parent 92af623 commit 2624d41

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/next/src/next-devtools/dev-overlay/components/call-stack/call-stack.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export function CallStack({
2323
</p>
2424
{ignoredFramesTally > 0 && (
2525
<button
26-
data-nextjs-call-stack-ignored-list-toggle-button
26+
// The isIgnoreListOpen value is used by tests to confirm whether it is open or not.
27+
data-nextjs-call-stack-ignored-list-toggle-button={isIgnoreListOpen}
2728
onClick={onToggleIgnoreList}
2829
>
2930
{`${isIgnoreListOpen ? 'Hide' : 'Show'} ${ignoredFramesTally} ignore-listed frame(s)`}

test/lib/next-test-utils.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,12 +1678,18 @@ export async function getStackFramesContent(browser) {
16781678
}
16791679

16801680
export async function toggleCollapseCallStackFrames(browser: Playwright) {
1681-
const button = await browser.elementByCss('[data-expand-ignore-button]')
1682-
const lastExpanded = await button.getAttribute('data-expand-ignore-button')
1681+
const button = await browser.elementByCss(
1682+
'[data-nextjs-call-stack-ignored-list-toggle-button]'
1683+
)
1684+
const lastExpanded = await button.getAttribute(
1685+
'data-nextjs-call-stack-ignored-list-toggle-button'
1686+
)
16831687
await button.click()
16841688

16851689
await retry(async () => {
1686-
const currExpanded = await button.getAttribute('data-expand-ignore-button')
1690+
const currExpanded = await button.getAttribute(
1691+
'data-nextjs-call-stack-ignored-list-toggle-button'
1692+
)
16871693
expect(currExpanded).not.toBe(lastExpanded)
16881694
})
16891695
}

0 commit comments

Comments
 (0)