import { nextTestSetup } from 'e2e-utils' import { getRedboxSource, openRedbox, getRedboxCallStack, } from 'next-test-utils' describe('app-dir - owner-stack-react-missing-key-prop', () => { const { isTurbopack, next } = nextTestSetup({ files: __dirname, }) it('should catch invalid element from on rsc component', async () => { const browser = await next.browser('/rsc') await openRedbox(browser) const stackFramesContent = await getRedboxCallStack(browser) const source = await getRedboxSource(browser) if (isTurbopack) { expect(stackFramesContent).toMatchInlineSnapshot(` [ "span ", " app/rsc/page.tsx (7:9)", "Array.map ", "Page app/rsc/page.tsx (6:13)", ] `) expect(source).toMatchInlineSnapshot(` "app/rsc/page.tsx (7:9) @ 5 |
6 | {list.map((item, index) => ( > 7 | {item} | ^ 8 | ))} 9 |
10 | )" `) } else { expect(stackFramesContent).toMatchInlineSnapshot(` [ "span ", "eval app/rsc/page.tsx (7:9)", "Array.map ", "Page app/rsc/page.tsx (6:13)", ] `) expect(source).toMatchInlineSnapshot(` "app/rsc/page.tsx (7:9) @ eval 5 |
6 | {list.map((item, index) => ( > 7 | {item} | ^ 8 | ))} 9 |
10 | )" `) } }) it('should catch invalid element from on ssr client component', async () => { const browser = await next.browser('/ssr') await openRedbox(browser) const stackFramesContent = await getRedboxCallStack(browser) const source = await getRedboxSource(browser) if (isTurbopack) { expect(stackFramesContent).toMatchInlineSnapshot(` [ "p ", " app/ssr/page.tsx (9:9)", "Array.map ", "Page app/ssr/page.tsx (8:13)", ] `) expect(source).toMatchInlineSnapshot(` "app/ssr/page.tsx (9:9) @ 7 |
8 | {list.map((item, index) => ( > 9 |

{item}

| ^ 10 | ))} 11 |
12 | )" `) } else { expect(stackFramesContent).toMatchInlineSnapshot(` [ "p ", "eval app/ssr/page.tsx (9:9)", "Array.map ", "Page app/ssr/page.tsx (8:13)", ] `) expect(source).toMatchInlineSnapshot(` "app/ssr/page.tsx (9:9) @ eval 7 |
8 | {list.map((item, index) => ( > 9 |

{item}

| ^ 10 | ))} 11 |
12 | )" `) } }) })