@@ -48,6 +48,21 @@ describe("URL generation", function () {
4848 expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path_alt.jpg` ) ;
4949 } ) ;
5050
51+ it ( "By default transformationPosition should be query" , function ( ) {
52+ var imagekitNew = new ImageKit ( {
53+ publicKey : "test_public_key" ,
54+ urlEndpoint : "https://ik.imagekit.io/test_url_endpoint" ,
55+ } ) ;
56+ const url = imagekitNew . url ( {
57+ path : "/test_path.jpg" ,
58+ transformation : [ {
59+ "height" : "300" ,
60+ "width" : "400"
61+ } ]
62+ } ) ;
63+ expect ( url ) . equal ( "https://ik.imagekit.io/test_url_endpoint/test_path.jpg?tr=h-300,w-400" ) ;
64+ } ) ;
65+
5166 it ( 'should generate the URL without sdk version' , function ( ) {
5267 const ik = new ImageKit ( { ...initializationParams , sdkVersion : "" } )
5368
@@ -111,7 +126,7 @@ describe("URL generation", function () {
111126 } ]
112127 } ) ;
113128
114- expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path.jpg?tr=h-300%2Cw -400` ) ;
129+ expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path.jpg?tr=h-300,w -400` ) ;
115130 } ) ;
116131
117132 it ( 'should generate the correct URL with a valid src parameter and transformation' , function ( ) {
@@ -123,7 +138,7 @@ describe("URL generation", function () {
123138 } ]
124139 } ) ;
125140
126- expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path_alt.jpg?tr=h-300%2Cw -400` ) ;
141+ expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path_alt.jpg?tr=h-300,w -400` ) ;
127142 } ) ;
128143
129144 it ( 'should generate the correct URL with transformationPosition as query parameter when src is provided' , function ( ) {
@@ -136,7 +151,7 @@ describe("URL generation", function () {
136151 } ]
137152 } ) ;
138153
139- expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path_alt.jpg?tr=h-300%2Cw -400` ) ;
154+ expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path_alt.jpg?tr=h-300,w -400` ) ;
140155 } ) ;
141156
142157 it ( 'should merge query parameters correctly in the generated URL' , function ( ) {
@@ -149,7 +164,7 @@ describe("URL generation", function () {
149164 } ]
150165 } ) ;
151166
152- expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path_alt.jpg?t1=v1&t2=v2&t3=v3&tr=h-300%2Cw -400` ) ;
167+ expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/test_path_alt.jpg?t1=v1&t2=v2&t3=v3&tr=h-300,w -400` ) ;
153168 } ) ;
154169
155170
0 commit comments