Skip to content

Commit

Permalink
chore(test): fix typo occured => occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Mar 14, 2024
1 parent 847b340 commit 53ebc3a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
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

0 comments on commit 53ebc3a

Please sign in to comment.