Skip to content

Commit 7c49e85

Browse files
committed
* test(ipfs.test.ts): add test for successful response with status code 200 and content type text/html
1 parent 50e05b6 commit 7c49e85

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

image/src/tests/ipfs.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,22 @@ test('ipfs - 301 - html', async () => {
100100
}
101101
`)
102102
})
103+
104+
test('ipfs - 200 - html', async () => {
105+
const res = await fetch(
106+
'https://image-beta.w.kodadot.xyz/ipfs/bafybeiakkzle3zsycvzpnkqtffqyq7njkt63vnmatkwijbg7kchq6s4she/?hash=0x850b8f12e91fe48ad55cfb6bd8ee7b33adde24ebdf266ff8d23667c828c7e989'
107+
)
108+
109+
expect(res.ok).toBe(true)
110+
expect(res.status).toBe(200)
111+
expect(res.headers.get('content-type')).toBe('text/html')
112+
113+
const data = await res.blob()
114+
expect(data).toMatchInlineSnapshot(`
115+
Blob {
116+
Symbol(kHandle): Blob {},
117+
Symbol(kLength): 657,
118+
Symbol(kType): "text/html",
119+
}
120+
`)
121+
})

0 commit comments

Comments
 (0)