File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
test/integration/image-component/unicode Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,13 @@ const Page = () => {
1414 width = { 400 }
1515 height = { 400 }
1616 />
17+ < Image id = "internal-precent" src = "/50%.jpg" width = { 200 } height = { 200 } />
18+ < Image
19+ id = "external-precent"
20+ src = "https://image-optimization-test.vercel.app/50%.jpg"
21+ width = { 200 }
22+ height = { 200 }
23+ />
1724 </ div >
1825 )
1926}
Original file line number Diff line number Diff line change @@ -44,6 +44,26 @@ function runTests() {
4444 const res = await fetch ( src )
4545 expect ( res . status ) . toBe ( 200 )
4646 } )
47+
48+ it ( 'should load internal percent image' , async ( ) => {
49+ const src = await browser
50+ . elementById ( 'internal-precent' )
51+ . getAttribute ( 'src' )
52+ expect ( src ) . toMatch ( '/_next/image?url=%2F50%25.jpg' )
53+ const res = await fetch ( src )
54+ expect ( res . status ) . toBe ( 200 )
55+ } )
56+
57+ it ( 'should load external percent image' , async ( ) => {
58+ const src = await browser
59+ . elementById ( 'external-precent' )
60+ . getAttribute ( 'src' )
61+ expect ( src ) . toMatch (
62+ '/_next/image?url=https%3A%2F%2Fimage-optimization-test.vercel.app%2F50%25.jpg'
63+ )
64+ const res = await fetch ( src )
65+ expect ( res . status ) . toBe ( 200 )
66+ } )
4767}
4868
4969describe ( 'Image Component Unicode Image URL' , ( ) => {
You can’t perform that action at this time.
0 commit comments