Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a1642c54
Commit
a1642c54
authored
Apr 09, 2026
by
Janka Uryga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for metadata images
parent
644f6583
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
201 additions
and
0 deletions
+201
-0
icon.tsx
...pp/suspense-in-root/metadata-images/dynamic-icon/icon.tsx
+22
-0
page.tsx
...pp/suspense-in-root/metadata-images/dynamic-icon/page.tsx
+5
-0
icon.ico
...app/suspense-in-root/metadata-images/static-icon/icon.ico
+0
-0
page.tsx
...app/suspense-in-root/metadata-images/static-icon/page.tsx
+5
-0
icon.tsx
...es/with-params/[slug]/dynamic-icon-unused-params/icon.tsx
+22
-0
page.tsx
...es/with-params/[slug]/dynamic-icon-unused-params/page.tsx
+9
-0
icon.tsx
...ages/with-params/[slug]/dynamic-icon-used-params/icon.tsx
+27
-0
page.tsx
...ages/with-params/[slug]/dynamic-icon-used-params/page.tsx
+29
-0
icon.ico
...t/metadata-images/with-params/[slug]/static-icon/icon.ico
+0
-0
page.tsx
...t/metadata-images/with-params/[slug]/static-icon/page.tsx
+5
-0
instant-validation.test.ts
...e2e/app-dir/instant-validation/instant-validation.test.ts
+77
-0
No files found.
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/dynamic-icon/icon.tsx
0 → 100644
View file @
a1642c54
import
{
ImageResponse
}
from
'next/og'
export
default
function
Icon
()
{
return
new
ImageResponse
(
(
<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
fontSize
:
88
,
background
:
'#fff'
,
color
:
'#000'
,
}
}
>
Icon
</
div
>
)
)
}
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/dynamic-icon/page.tsx
0 → 100644
View file @
a1642c54
export
const
unstable_instant
=
{
prefetch
:
'static'
}
export
default
function
Page
()
{
return
<
main
>
This is a static page with an icon component.
</
main
>
}
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/static-icon/icon.ico
0 → 100644
View file @
a1642c54
14.7 KB
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/static-icon/page.tsx
0 → 100644
View file @
a1642c54
export
const
unstable_instant
=
{
prefetch
:
'static'
}
export
default
function
Page
()
{
return
<
main
>
This is a static page with a static icon.
</
main
>
}
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/with-params/[slug]/dynamic-icon-unused-params/icon.tsx
0 → 100644
View file @
a1642c54
import
{
ImageResponse
}
from
'next/og'
export
default
function
Icon
()
{
return
new
ImageResponse
(
(
<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
fontSize
:
88
,
background
:
'#fff'
,
color
:
'#000'
,
}
}
>
Favicon
</
div
>
)
)
}
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/with-params/[slug]/dynamic-icon-unused-params/page.tsx
0 → 100644
View file @
a1642c54
export
const
unstable_instant
=
{
prefetch
:
'static'
}
export
default
function
Page
()
{
return
(
<
main
>
This is a static page with an icon component that does not use params.
</
main
>
)
}
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/with-params/[slug]/dynamic-icon-used-params/icon.tsx
0 → 100644
View file @
a1642c54
import
{
ImageResponse
}
from
'next/og'
export
default
async
function
Icon
({
params
,
}:
{
params
:
Promise
<
{
slug
:
string
}
>
})
{
const
{
slug
}
=
await
params
return
new
ImageResponse
(
(
<
div
style=
{
{
width
:
'100%'
,
height
:
'100%'
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
fontSize
:
88
,
background
:
'#fff'
,
color
:
'#000'
,
}
}
>
{
slug
}
</
div
>
)
)
}
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/with-params/[slug]/dynamic-icon-used-params/page.tsx
0 → 100644
View file @
a1642c54
import
{
Instant
}
from
'next'
import
{
connection
}
from
'next/server'
import
{
Suspense
}
from
'react'
export
const
unstable_instant
:
Instant
=
{
prefetch
:
'static'
,
samples
:
[{
params
:
{
slug
:
'123'
}
}],
}
export
default
function
Page
()
{
return
(
<
main
>
<
p
>
This is a page with an icon component that uses params. It has a dynamic
hole, because a static page can't have non-static metadata.
</
p
>
<
Suspense
>
<
Dummy
/>
</
Suspense
>
</
main
>
)
}
async
function
Dummy
()
{
// TODO(instant-validation): this shouldn't need connection(), cookies should be enough
// await cookies()
await
connection
()
return
null
}
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/with-params/[slug]/static-icon/icon.ico
0 → 100644
View file @
a1642c54
14.7 KB
test/e2e/app-dir/instant-validation/app/suspense-in-root/metadata-images/with-params/[slug]/static-icon/page.tsx
0 → 100644
View file @
a1642c54
export
const
unstable_instant
=
{
prefetch
:
'static'
}
export
default
function
Page
()
{
return
<
main
>
This is a static page with a static icon.
</
main
>
}
test/e2e/app-dir/instant-validation/instant-validation.test.ts
View file @
a1642c54
...
@@ -3345,6 +3345,83 @@ describe('instant validation', () => {
...
@@ -3345,6 +3345,83 @@ describe('instant validation', () => {
})
})
})
})
describe
(
'metadata images'
,
()
=>
{
it
(
'valid - static icon'
,
async
()
=>
{
if
(
isNextDev
)
{
const
browser
=
await
navigateTo
(
'/suspense-in-root/metadata-images/static-icon'
)
await
expectNoDevValidationErrors
(
browser
,
await
browser
.
url
())
}
else
{
const
result
=
await
prerender
(
'/suspense-in-root/metadata-images/static-icon'
)
expectNoBuildValidationErrors
(
result
)
expect
(
result
.
exitCode
).
toBe
(
0
)
}
})
it
(
'valid - dynamic icon'
,
async
()
=>
{
if
(
isNextDev
)
{
const
browser
=
await
navigateTo
(
'/suspense-in-root/metadata-images/dynamic-icon'
)
await
expectNoDevValidationErrors
(
browser
,
await
browser
.
url
())
}
else
{
const
result
=
await
prerender
(
'/suspense-in-root/metadata-images/dynamic-icon'
)
expectNoBuildValidationErrors
(
result
)
expect
(
result
.
exitCode
).
toBe
(
0
)
}
})
it
(
'valid - static icon with params'
,
async
()
=>
{
if
(
isNextDev
)
{
const
browser
=
await
navigateTo
(
'/suspense-in-root/metadata-images/with-params/123/static-icon'
)
await
expectNoDevValidationErrors
(
browser
,
await
browser
.
url
())
}
else
{
const
result
=
await
prerender
(
'/suspense-in-root/metadata-images/with-params/[slug]/static-icon'
)
expectNoBuildValidationErrors
(
result
)
expect
(
result
.
exitCode
).
toBe
(
0
)
}
})
it
(
'valid - dynamic icon with unused params'
,
async
()
=>
{
if
(
isNextDev
)
{
const
browser
=
await
navigateTo
(
'/suspense-in-root/metadata-images/with-params/123/dynamic-icon-unused-params'
)
await
expectNoDevValidationErrors
(
browser
,
await
browser
.
url
())
}
else
{
const
result
=
await
prerender
(
'/suspense-in-root/metadata-images/with-params/[slug]/dynamic-icon-unused-params'
)
expectNoBuildValidationErrors
(
result
)
expect
(
result
.
exitCode
).
toBe
(
0
)
}
})
it
(
'valid - dynamic icon used params'
,
async
()
=>
{
if
(
isNextDev
)
{
const
browser
=
await
navigateTo
(
'/suspense-in-root/metadata-images/with-params/123/dynamic-icon-used-params'
)
await
expectNoDevValidationErrors
(
browser
,
await
browser
.
url
())
}
else
{
const
result
=
await
prerender
(
'/suspense-in-root/metadata-images/with-params/[slug]/dynamic-icon-used-params'
)
expectNoBuildValidationErrors
(
result
)
expect
(
result
.
exitCode
).
toBe
(
0
)
}
})
})
describe
(
'disabling validation'
,
()
=>
{
describe
(
'disabling validation'
,
()
=>
{
it
(
'in a layout'
,
async
()
=>
{
it
(
'in a layout'
,
async
()
=>
{
if
(
isNextDev
)
{
if
(
isNextDev
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment