@@ -49,7 +49,7 @@ test('type-endpoint - 200 - json', async () => {
4949
5050test ( 'type-endpoint - 302 - image' , async ( ) => {
5151 const res = await fetch (
52- 'https://image-beta .w.kodadot.xyz/type/endpoint/https://polkadot-data.s3.us-east-2.amazonaws.com/metadata/nfts-88/nfts-88_collection-img.png ' ,
52+ 'https://image.w.kodadot.xyz/type/endpoint/https://dyndata.koda.art/v1/image/ahp/337/259197561 ' ,
5353 { redirect : 'manual' }
5454 )
5555
@@ -58,19 +58,23 @@ test('type-endpoint - 302 - image', async () => {
5858
5959 const redirectURL = res . headers . get ( 'location' )
6060 expect ( redirectURL ) . toBe (
61- 'https://imagedelivery.net/jk5b6spi_m_-9qC4VTnjpg/https---polkadot-data-s3-us-east-2-amazonaws-com-metadata-nfts-88-nfts-88-collection-img-png /public'
61+ 'https://imagedelivery.net/jk5b6spi_m_-9qC4VTnjpg/https---dyndata-koda-art-v1-image-ahp-337-259197561 /public'
6262 )
6363
64+ if ( ! redirectURL ) {
65+ throw new Error ( 'Redirect URL is null' )
66+ }
67+
6468 const res2 = await fetch ( redirectURL )
6569 expect ( res2 . ok ) . toBe ( true )
66- expect ( res2 . headers . get ( 'content-type' ) ) . toBe ( 'image/png ' )
70+ expect ( res2 . headers . get ( 'content-type' ) ) . toBe ( 'image/jpeg ' )
6771
6872 const data = await res2 . blob ( )
6973 expect ( data ) . toMatchInlineSnapshot ( `
7074 Blob {
7175 Symbol(kHandle): Blob {},
72- Symbol(kLength): 86717 ,
73- Symbol(kType): "image/png ",
76+ Symbol(kLength): 126132 ,
77+ Symbol(kType): "image/jpeg ",
7478 }
7579 ` )
7680} )
0 commit comments