@@ -15,6 +15,12 @@ describe("URL generation", function () {
1515 expect ( url ) . equal ( "" ) ;
1616 } ) ;
1717
18+ it ( 'invalid src url' , function ( ) {
19+ const url = imagekit . url ( { src : "/" } ) ;
20+
21+ expect ( url ) . equal ( "" ) ;
22+ } ) ;
23+
1824 it ( 'no transformation path' , function ( ) {
1925 const url = imagekit . url ( {
2026 path : "/test_path.jpg"
@@ -214,6 +220,42 @@ describe("URL generation", function () {
214220 expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/tr:h-300,w-400,b-20_FF0000/test_path.jpg?ik-sdk-version=javascript-${ pkg . version } ` ) ;
215221 } ) ;
216222
223+ it ( 'transformation with empty key and empty value' , function ( ) {
224+ const url = imagekit . url ( {
225+ path : "/test_path.jpg" ,
226+ transformation : [ {
227+ "" : ""
228+ } ]
229+ } )
230+
231+ expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/tr:-/test_path.jpg?ik-sdk-version=javascript-${ pkg . version } ` ) ;
232+ } ) ;
233+
234+ /**
235+ * Provided to provide support to a new transform without sdk update
236+ */
237+ it ( 'transformation with undefined transform' , function ( ) {
238+ const url = imagekit . url ( {
239+ path : "/test_path.jpg" ,
240+ transformation : [ {
241+ "undefined-transform" : "true"
242+ } ]
243+ } )
244+
245+ expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/tr:undefined-transform-true/test_path.jpg?ik-sdk-version=javascript-${ pkg . version } ` ) ;
246+ } ) ;
247+
248+ it ( 'transformation with empty key and value' , function ( ) {
249+ const url = imagekit . url ( {
250+ path : "/test_path.jpg" ,
251+ transformation : [ {
252+ effectContrast : "-"
253+ } ]
254+ } )
255+
256+ expect ( url ) . equal ( `https://ik.imagekit.io/test_url_endpoint/tr:e-contrast/test_path.jpg?ik-sdk-version=javascript-${ pkg . version } ` ) ;
257+ } ) ;
258+
217259 it ( 'All combined' , function ( ) {
218260 const url = imagekit . url ( {
219261 path : "/test_path.jpg" ,
0 commit comments