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
d8a58b5a
Unverified
Commit
d8a58b5a
authored
Mar 14, 2024
by
Steven
Committed by
GitHub
Mar 14, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(test): fix typo occured => occurred (#63287)
Closes
https://github.com/vercel/next.js/pull/63276
Closes NEXT-2818
parent
6556a342
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
26 deletions
+26
-26
on-error.js
test/integration/next-image-legacy/default/pages/on-error.js
+3
-3
index.test.ts
.../integration/next-image-legacy/default/test/index.test.ts
+3
-3
page.js
test/integration/next-image-new/app-dir/app/on-error/page.js
+3
-3
index.test.ts
test/integration/next-image-new/app-dir/test/index.test.ts
+4
-4
on-error.js
test/integration/next-image-new/default/pages/on-error.js
+3
-3
index.test.ts
test/integration/next-image-new/default/test/index.test.ts
+4
-4
turbopack-tests-manifest.json
test/turbopack-tests-manifest.json
+6
-6
No files found.
test/integration/next-image-legacy/default/pages/on-error.js
View file @
d8a58b5a
...
@@ -6,7 +6,7 @@ const Page = () => {
...
@@ -6,7 +6,7 @@ const Page = () => {
<
div
>
<
div
>
<
h1
>
Test
onError
<
/h1
>
<
h1
>
Test
onError
<
/h1
>
<
p
>
<
p
>
If
error
occured
while
loading
image
,
native
onError
should
be
called
.
If
error
occur
r
ed
while
loading
image
,
native
onError
should
be
called
.
<
/p
>
<
/p
>
<
ImageWithMessage
id
=
"1"
src
=
"/test.png"
layout
=
"fill"
/>
<
ImageWithMessage
id
=
"1"
src
=
"/test.png"
layout
=
"fill"
/>
...
@@ -17,7 +17,7 @@ const Page = () => {
...
@@ -17,7 +17,7 @@ const Page = () => {
}
}
function
ImageWithMessage
({
id
,
...
props
})
{
function
ImageWithMessage
({
id
,
...
props
})
{
const
[
msg
,
setMsg
]
=
useState
(
'no error occured'
)
const
[
msg
,
setMsg
]
=
useState
(
'no error occur
r
ed'
)
const
style
=
const
style
=
props
.
layout
===
'fill'
props
.
layout
===
'fill'
?
{
position
:
'relative'
,
width
:
'64px'
,
height
:
'64px'
}
?
{
position
:
'relative'
,
width
:
'64px'
,
height
:
'64px'
}
...
@@ -29,7 +29,7 @@ function ImageWithMessage({ id, ...props }) {
...
@@ -29,7 +29,7 @@ function ImageWithMessage({ id, ...props }) {
<
Image
<
Image
id
=
{
`img
${
id
}
`
}
id
=
{
`img
${
id
}
`
}
onError
=
{(
e
)
=>
{
onError
=
{(
e
)
=>
{
const
msg
=
`error occured while loading
${
e
.
target
.
id
}
`
const
msg
=
`error occur
r
ed while loading
${
e
.
target
.
id
}
`
setMsg
(
msg
)
setMsg
(
msg
)
}}
}}
{...
props
}
{...
props
}
...
...
test/integration/next-image-legacy/default/test/index.test.ts
View file @
d8a58b5a
...
@@ -398,7 +398,7 @@ function runTests(mode) {
...
@@ -398,7 +398,7 @@ function runTests(mode) {
)
)
})
})
it
(
'should callback native onError when error occured while loading image'
,
async
()
=>
{
it
(
'should callback native onError when error occur
r
ed while loading image'
,
async
()
=>
{
let
browser
=
await
webdriver
(
appPort
,
'/on-error'
)
let
browser
=
await
webdriver
(
appPort
,
'/on-error'
)
await
check
(
await
check
(
...
@@ -412,11 +412,11 @@ function runTests(mode) {
...
@@ -412,11 +412,11 @@ function runTests(mode) {
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg1").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg1").textContent`
),
'no error occured'
'no error occur
r
ed'
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
'error occured while loading img2'
'error occur
r
ed while loading img2'
)
)
})
})
...
...
test/integration/next-image-new/app-dir/app/on-error/page.js
View file @
d8a58b5a
...
@@ -9,7 +9,7 @@ const Page = () => {
...
@@ -9,7 +9,7 @@ const Page = () => {
<
div
>
<
div
>
<
h1
>
Test
onError
<
/h1
>
<
h1
>
Test
onError
<
/h1
>
<
p
>
<
p
>
If
error
occured
while
loading
image
,
native
onError
should
be
called
.
If
error
occur
r
ed
while
loading
image
,
native
onError
should
be
called
.
<
/p
>
<
/p
>
<
button
id
=
"toggle"
onClick
=
{()
=>
setClicked
(
!
clicked
)}
>
<
button
id
=
"toggle"
onClick
=
{()
=>
setClicked
(
!
clicked
)}
>
Toggle
Toggle
...
@@ -28,7 +28,7 @@ const Page = () => {
...
@@ -28,7 +28,7 @@ const Page = () => {
}
}
function
ImageWithMessage
({
id
,
...
props
})
{
function
ImageWithMessage
({
id
,
...
props
})
{
const
[
msg
,
setMsg
]
=
useState
(
`no error occured for img
${
id
}
`
)
const
[
msg
,
setMsg
]
=
useState
(
`no error occur
r
ed for img
${
id
}
`
)
return
(
return
(
<>
<>
...
@@ -36,7 +36,7 @@ function ImageWithMessage({ id, ...props }) {
...
@@ -36,7 +36,7 @@ function ImageWithMessage({ id, ...props }) {
<
Image
<
Image
id
=
{
`img
${
id
}
`
}
id
=
{
`img
${
id
}
`
}
onError
=
{(
e
)
=>
{
onError
=
{(
e
)
=>
{
setMsg
(
`error occured while loading
${
e
.
target
.
id
}
`
)
setMsg
(
`error occur
r
ed while loading
${
e
.
target
.
id
}
`
)
}}
}}
{...
props
}
{...
props
}
/
>
/
>
...
...
test/integration/next-image-new/app-dir/test/index.test.ts
View file @
d8a58b5a
...
@@ -460,14 +460,14 @@ function runTests(mode) {
...
@@ -460,14 +460,14 @@ function runTests(mode) {
)
)
})
})
it
(
'should callback native onError when error occured while loading image'
,
async
()
=>
{
it
(
'should callback native onError when error occur
r
ed while loading image'
,
async
()
=>
{
let
browser
=
await
webdriver
(
appPort
,
'/on-error'
)
let
browser
=
await
webdriver
(
appPort
,
'/on-error'
)
await
browser
.
eval
(
await
browser
.
eval
(
`document.getElementById("img1").scrollIntoView({behavior: "smooth"})`
`document.getElementById("img1").scrollIntoView({behavior: "smooth"})`
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg1").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg1").textContent`
),
'no error occured for img1'
'no error occur
r
ed for img1'
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("img1").style.color`
),
()
=>
browser
.
eval
(
`document.getElementById("img1").style.color`
),
...
@@ -478,7 +478,7 @@ function runTests(mode) {
...
@@ -478,7 +478,7 @@ function runTests(mode) {
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
'no error occured for img2'
'no error occur
r
ed for img2'
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
...
@@ -487,7 +487,7 @@ function runTests(mode) {
...
@@ -487,7 +487,7 @@ function runTests(mode) {
await
browser
.
eval
(
`document.getElementById("toggle").click()`
)
await
browser
.
eval
(
`document.getElementById("toggle").click()`
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
'error occured while loading img2'
'error occur
r
ed while loading img2'
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
...
...
test/integration/next-image-new/default/pages/on-error.js
View file @
d8a58b5a
...
@@ -8,7 +8,7 @@ const Page = () => {
...
@@ -8,7 +8,7 @@ const Page = () => {
<
div
>
<
div
>
<
h1
>
Test
onError
<
/h1
>
<
h1
>
Test
onError
<
/h1
>
<
p
>
<
p
>
If
error
occured
while
loading
image
,
native
onError
should
be
called
.
If
error
occur
r
ed
while
loading
image
,
native
onError
should
be
called
.
<
/p
>
<
/p
>
<
button
id
=
"toggle"
onClick
=
{()
=>
setClicked
(
!
clicked
)}
>
<
button
id
=
"toggle"
onClick
=
{()
=>
setClicked
(
!
clicked
)}
>
Toggle
Toggle
...
@@ -27,7 +27,7 @@ const Page = () => {
...
@@ -27,7 +27,7 @@ const Page = () => {
}
}
function
ImageWithMessage
({
id
,
...
props
})
{
function
ImageWithMessage
({
id
,
...
props
})
{
const
[
msg
,
setMsg
]
=
useState
(
`no error occured for img
${
id
}
`
)
const
[
msg
,
setMsg
]
=
useState
(
`no error occur
r
ed for img
${
id
}
`
)
return
(
return
(
<>
<>
...
@@ -35,7 +35,7 @@ function ImageWithMessage({ id, ...props }) {
...
@@ -35,7 +35,7 @@ function ImageWithMessage({ id, ...props }) {
<
Image
<
Image
id
=
{
`img
${
id
}
`
}
id
=
{
`img
${
id
}
`
}
onError
=
{(
e
)
=>
{
onError
=
{(
e
)
=>
{
setMsg
(
`error occured while loading
${
e
.
target
.
id
}
`
)
setMsg
(
`error occur
r
ed while loading
${
e
.
target
.
id
}
`
)
}}
}}
{...
props
}
{...
props
}
/
>
/
>
...
...
test/integration/next-image-new/default/test/index.test.ts
View file @
d8a58b5a
...
@@ -461,14 +461,14 @@ function runTests(mode) {
...
@@ -461,14 +461,14 @@ function runTests(mode) {
)
)
})
})
it
(
'should callback native onError when error occured while loading image'
,
async
()
=>
{
it
(
'should callback native onError when error occur
r
ed while loading image'
,
async
()
=>
{
let
browser
=
await
webdriver
(
appPort
,
'/on-error'
)
let
browser
=
await
webdriver
(
appPort
,
'/on-error'
)
await
browser
.
eval
(
await
browser
.
eval
(
`document.getElementById("img1").scrollIntoView({behavior: "smooth"})`
`document.getElementById("img1").scrollIntoView({behavior: "smooth"})`
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg1").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg1").textContent`
),
'no error occured for img1'
'no error occur
r
ed for img1'
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("img1").style.color`
),
()
=>
browser
.
eval
(
`document.getElementById("img1").style.color`
),
...
@@ -479,7 +479,7 @@ function runTests(mode) {
...
@@ -479,7 +479,7 @@ function runTests(mode) {
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
'no error occured for img2'
'no error occur
r
ed for img2'
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
...
@@ -488,7 +488,7 @@ function runTests(mode) {
...
@@ -488,7 +488,7 @@ function runTests(mode) {
await
browser
.
eval
(
`document.getElementById("toggle").click()`
)
await
browser
.
eval
(
`document.getElementById("toggle").click()`
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg2").textContent`
),
'error occured while loading img2'
'error occur
r
ed while loading img2'
)
)
await
check
(
await
check
(
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
()
=>
browser
.
eval
(
`document.getElementById("img2").style.color`
),
...
...
test/turbopack-tests-manifest.json
View file @
d8a58b5a
...
@@ -13585,7 +13585,7 @@
...
@@ -13585,7 +13585,7 @@
"Image Component Tests dev mode should apply filter style after image loads"
,
"Image Component Tests dev mode should apply filter style after image loads"
,
"Image Component Tests dev mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Tests dev mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Tests dev mode should be valid HTML"
,
"Image Component Tests dev mode should be valid HTML"
,
"Image Component Tests dev mode should callback native onError when error occured while loading image"
,
"Image Component Tests dev mode should callback native onError when error occur
r
ed while loading image"
,
"Image Component Tests dev mode should callback native onLoad in most cases"
,
"Image Component Tests dev mode should callback native onLoad in most cases"
,
"Image Component Tests dev mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Tests dev mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Tests dev mode should correctly ignore prose styles"
,
"Image Component Tests dev mode should correctly ignore prose styles"
,
...
@@ -13629,7 +13629,7 @@
...
@@ -13629,7 +13629,7 @@
"Image Component Tests production mode should apply filter style after image loads"
,
"Image Component Tests production mode should apply filter style after image loads"
,
"Image Component Tests production mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Tests production mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Tests production mode should be valid HTML"
,
"Image Component Tests production mode should be valid HTML"
,
"Image Component Tests production mode should callback native onError when error occured while loading image"
,
"Image Component Tests production mode should callback native onError when error occur
r
ed while loading image"
,
"Image Component Tests production mode should callback native onLoad in most cases"
,
"Image Component Tests production mode should callback native onLoad in most cases"
,
"Image Component Tests production mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Tests production mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Tests production mode should correctly ignore prose styles"
,
"Image Component Tests production mode should correctly ignore prose styles"
,
...
@@ -13805,7 +13805,7 @@
...
@@ -13805,7 +13805,7 @@
"Image Component Default Tests dev mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests dev mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests dev mode should be valid HTML"
,
"Image Component Default Tests dev mode should be valid HTML"
,
"Image Component Default Tests dev mode should callback native onError even when error before hydration"
,
"Image Component Default Tests dev mode should callback native onError even when error before hydration"
,
"Image Component Default Tests dev mode should callback native onError when error occured while loading image"
,
"Image Component Default Tests dev mode should callback native onError when error occur
r
ed while loading image"
,
"Image Component Default Tests dev mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests dev mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests dev mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests dev mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests dev mode should correctly ignore prose styles"
,
"Image Component Default Tests dev mode should correctly ignore prose styles"
,
...
@@ -13861,7 +13861,7 @@
...
@@ -13861,7 +13861,7 @@
"Image Component Default Tests production mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests production mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests production mode should be valid HTML"
,
"Image Component Default Tests production mode should be valid HTML"
,
"Image Component Default Tests production mode should callback native onError even when error before hydration"
,
"Image Component Default Tests production mode should callback native onError even when error before hydration"
,
"Image Component Default Tests production mode should callback native onError when error occured while loading image"
,
"Image Component Default Tests production mode should callback native onError when error occur
r
ed while loading image"
,
"Image Component Default Tests production mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests production mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests production mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests production mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests production mode should correctly ignore prose styles"
,
"Image Component Default Tests production mode should correctly ignore prose styles"
,
...
@@ -14020,7 +14020,7 @@
...
@@ -14020,7 +14020,7 @@
"Image Component Default Tests dev mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests dev mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests dev mode should be valid HTML"
,
"Image Component Default Tests dev mode should be valid HTML"
,
"Image Component Default Tests dev mode should callback native onError even when error before hydration"
,
"Image Component Default Tests dev mode should callback native onError even when error before hydration"
,
"Image Component Default Tests dev mode should callback native onError when error occured while loading image"
,
"Image Component Default Tests dev mode should callback native onError when error occur
r
ed while loading image"
,
"Image Component Default Tests dev mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests dev mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests dev mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests dev mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests dev mode should correctly ignore prose styles"
,
"Image Component Default Tests dev mode should correctly ignore prose styles"
,
...
@@ -14076,7 +14076,7 @@
...
@@ -14076,7 +14076,7 @@
"Image Component Default Tests production mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests production mode should apply style inheritance for img elements but not wrapper elements"
,
"Image Component Default Tests production mode should be valid HTML"
,
"Image Component Default Tests production mode should be valid HTML"
,
"Image Component Default Tests production mode should callback native onError even when error before hydration"
,
"Image Component Default Tests production mode should callback native onError even when error before hydration"
,
"Image Component Default Tests production mode should callback native onError when error occured while loading image"
,
"Image Component Default Tests production mode should callback native onError when error occur
r
ed while loading image"
,
"Image Component Default Tests production mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests production mode should callback native onLoad with sythetic event"
,
"Image Component Default Tests production mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests production mode should callback onLoadingComplete when image is fully loaded"
,
"Image Component Default Tests production mode should correctly ignore prose styles"
,
"Image Component Default Tests production mode should correctly ignore prose styles"
,
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