Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): fix typo occured => occurred #63287

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/integration/next-image-legacy/default/pages/on-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Page = () => {
<div>
<h1>Test onError</h1>
<p>
If error occured while loading image, native onError should be called.
If error occurred while loading image, native onError should be called.
</p>
<ImageWithMessage id="1" src="/test.png" layout="fill" />

Expand All @@ -17,7 +17,7 @@ const Page = () => {
}

function ImageWithMessage({ id, ...props }) {
const [msg, setMsg] = useState('no error occured')
const [msg, setMsg] = useState('no error occurred')
const style =
props.layout === 'fill'
? { position: 'relative', width: '64px', height: '64px' }
Expand All @@ -29,7 +29,7 @@ function ImageWithMessage({ id, ...props }) {
<Image
id={`img${id}`}
onError={(e) => {
const msg = `error occured while loading ${e.target.id}`
const msg = `error occurred while loading ${e.target.id}`
setMsg(msg)
}}
{...props}
Expand Down
6 changes: 3 additions & 3 deletions test/integration/next-image-legacy/default/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 occurred while loading image', async () => {
let browser = await webdriver(appPort, '/on-error')

await check(
Expand All @@ -412,11 +412,11 @@ function runTests(mode) {
)
await check(
() => browser.eval(`document.getElementById("msg1").textContent`),
'no error occured'
'no error occurred'
)
await check(
() => browser.eval(`document.getElementById("msg2").textContent`),
'error occured while loading img2'
'error occurred while loading img2'
)
})

Expand Down
6 changes: 3 additions & 3 deletions test/integration/next-image-new/app-dir/app/on-error/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Page = () => {
<div>
<h1>Test onError</h1>
<p>
If error occured while loading image, native onError should be called.
If error occurred while loading image, native onError should be called.
</p>
<button id="toggle" onClick={() => setClicked(!clicked)}>
Toggle
Expand All @@ -28,15 +28,15 @@ const Page = () => {
}

function ImageWithMessage({ id, ...props }) {
const [msg, setMsg] = useState(`no error occured for img${id}`)
const [msg, setMsg] = useState(`no error occurred for img${id}`)

return (
<>
<div className="wrap">
<Image
id={`img${id}`}
onError={(e) => {
setMsg(`error occured while loading ${e.target.id}`)
setMsg(`error occurred while loading ${e.target.id}`)
}}
{...props}
/>
Expand Down
8 changes: 4 additions & 4 deletions test/integration/next-image-new/app-dir/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 occurred while loading image', async () => {
let browser = await webdriver(appPort, '/on-error')
await browser.eval(
`document.getElementById("img1").scrollIntoView({behavior: "smooth"})`
)
await check(
() => browser.eval(`document.getElementById("msg1").textContent`),
'no error occured for img1'
'no error occurred for img1'
)
await check(
() => browser.eval(`document.getElementById("img1").style.color`),
Expand All @@ -478,7 +478,7 @@ function runTests(mode) {
)
await check(
() => browser.eval(`document.getElementById("msg2").textContent`),
'no error occured for img2'
'no error occurred for img2'
)
await check(
() => browser.eval(`document.getElementById("img2").style.color`),
Expand All @@ -487,7 +487,7 @@ function runTests(mode) {
await browser.eval(`document.getElementById("toggle").click()`)
await check(
() => browser.eval(`document.getElementById("msg2").textContent`),
'error occured while loading img2'
'error occurred while loading img2'
)
await check(
() => browser.eval(`document.getElementById("img2").style.color`),
Expand Down
6 changes: 3 additions & 3 deletions test/integration/next-image-new/default/pages/on-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Page = () => {
<div>
<h1>Test onError</h1>
<p>
If error occured while loading image, native onError should be called.
If error occurred while loading image, native onError should be called.
</p>
<button id="toggle" onClick={() => setClicked(!clicked)}>
Toggle
Expand All @@ -27,15 +27,15 @@ const Page = () => {
}

function ImageWithMessage({ id, ...props }) {
const [msg, setMsg] = useState(`no error occured for img${id}`)
const [msg, setMsg] = useState(`no error occurred for img${id}`)

return (
<>
<div className="wrap">
<Image
id={`img${id}`}
onError={(e) => {
setMsg(`error occured while loading ${e.target.id}`)
setMsg(`error occurred while loading ${e.target.id}`)
}}
{...props}
/>
Expand Down
8 changes: 4 additions & 4 deletions test/integration/next-image-new/default/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 occurred while loading image', async () => {
let browser = await webdriver(appPort, '/on-error')
await browser.eval(
`document.getElementById("img1").scrollIntoView({behavior: "smooth"})`
)
await check(
() => browser.eval(`document.getElementById("msg1").textContent`),
'no error occured for img1'
'no error occurred for img1'
)
await check(
() => browser.eval(`document.getElementById("img1").style.color`),
Expand All @@ -479,7 +479,7 @@ function runTests(mode) {
)
await check(
() => browser.eval(`document.getElementById("msg2").textContent`),
'no error occured for img2'
'no error occurred for img2'
)
await check(
() => browser.eval(`document.getElementById("img2").style.color`),
Expand All @@ -488,7 +488,7 @@ function runTests(mode) {
await browser.eval(`document.getElementById("toggle").click()`)
await check(
() => browser.eval(`document.getElementById("msg2").textContent`),
'error occured while loading img2'
'error occurred while loading img2'
)
await check(
() => browser.eval(`document.getElementById("img2").style.color`),
Expand Down
12 changes: 6 additions & 6 deletions test/turbopack-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13585,7 +13585,7 @@
"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 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 occurred while loading image",
"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 correctly ignore prose styles",
Expand Down Expand Up @@ -13629,7 +13629,7 @@
"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 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 occurred while loading image",
"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 correctly ignore prose styles",
Expand Down Expand Up @@ -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 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 when error occured while loading image",
"Image Component Default Tests dev mode should callback native onError when error occurred while loading image",
"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 correctly ignore prose styles",
Expand Down Expand Up @@ -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 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 when error occured while loading image",
"Image Component Default Tests production mode should callback native onError when error occurred while loading image",
"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 correctly ignore prose styles",
Expand Down Expand Up @@ -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 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 when error occured while loading image",
"Image Component Default Tests dev mode should callback native onError when error occurred while loading image",
"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 correctly ignore prose styles",
Expand Down Expand Up @@ -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 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 when error occured while loading image",
"Image Component Default Tests production mode should callback native onError when error occurred while loading image",
"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 correctly ignore prose styles",
Expand Down