Skip to content

Commit 2a5052f

Browse files
committed
Add another test for percent
1 parent 00e5274 commit 2a5052f

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

test/integration/image-component/unicode/pages/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}
6.61 KB
Loading

test/integration/image-component/unicode/test/index.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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

4969
describe('Image Component Unicode Image URL', () => {

0 commit comments

Comments
 (0)