Unverified Commit 001a67df authored by Steven's avatar Steven Committed by GitHub

Add test fixture `e2e/app-dir/next-image` (#41609)

This PR adds a test fixture `e2e/app-dir/next-image` to ensure `next/image` works with the `app` dir.
parent 75aab126
This diff is collapsed.
import Image from 'next/image'
import testPng from '../images/test.png'
export default function Comp() {
return (
<div>
<h2>app-comp</h2>
<Image id="app-comp" src={testPng} quality={80} />
</div>
)
}
'use client'
import Image from 'next/image'
import testPng from '../../images/test.png'
export default function Comp() {
return (
<div>
<h2>app-client-comp</h2>
<Image id="app-client-comp" src={testPng} quality={50} />
</div>
)
}
'use client'
import Image from 'next/image'
import testPng from '../../images/test.png'
export default function ClientLayout({ children }) {
return (
<>
<h2>app-client-layout</h2>
<Image id="app-client-layout" src={testPng} quality={55} />
{children}
</>
)
}
'use client'
import Comp from './Comp'
import Image from 'next/image'
import testPng from '../../images/test.png'
export default function ClientPage() {
return (
<>
<h2>app-client-page</h2>
<Image id="app-client-page" src={testPng} quality={60} />
<Comp />
</>
)
}
import Image from 'next/image'
import testPng from '../images/test.png'
export default function Layout({ children }) {
return (
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h2>app-layout</h2>
<Image id="app-layout" src={testPng} quality={85} />
{children}
</body>
</html>
)
}
import Image from 'next/image'
import testJpg from './test.jpg'
export default function Comp() {
return (
<div>
<h2>app-nested-comp</h2>
<Image id="app-nested-comp" src={testJpg} quality={65} />
</div>
)
}
import Image from 'next/image'
import testJpg from './test.jpg'
export default function NestedLayout({ children }) {
return (
<>
<h2>app-nested-layout</h2>
<Image id="app-nested-layout" src={testJpg} quality={70} />
{children}
</>
)
}
import Comp from './Comp'
import Image from 'next/image'
import testJpg from './test.jpg'
export default function NestedPage() {
return (
<div>
<h2>app-nested-page</h2>
<Image id="app-nested-page" src={testJpg} quality={75} />
<Comp />
</div>
)
}
import Comp from './Comp'
import Image from 'next/image'
import testPng from '../images/test.png'
export default function Page() {
return (
<>
<h2>app-page</h2>
<Image id="app-page" src={testPng} quality={90} />
<Comp />
</>
)
}
export const runtime = 'experimental-edge'
module.exports = {
experimental: {
appDir: true,
},
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment