@@ -717,15 +717,6 @@ describe("utils", function () {
717717 [ "string" ,
718718 "text:hello" ,
719719 "text:hello" ] ,
720- [
721- "string" ,
722- {
723- "font_family" : "arial" ,
724- "font_size" : "30" ,
725- "text" : "abc,αβγ/אבג"
726- } ,
727- "text:arial_30:abc%252C%CE%B1%CE%B2%CE%B3%252F%D7%90%D7%91%D7%92"
728- ] ,
729720 [
730721 "public_id" ,
731722 {
@@ -1066,87 +1057,6 @@ describe("utils", function () {
10661057 . to . contain ( '$xpos_ctx:!x_pos!_to_f,$ypos_ctx:!y_pos!_to_f,c_crop,x_$xpos_mul_w,y_$ypos_mul_h' )
10671058 } ) ;
10681059 } ) ;
1069- describe ( 'User Define Variables' , function ( ) {
1070- it ( "array should define a set of variables" , function ( ) {
1071- var options , t ;
1072- options = {
1073- if : "face_count > 2" ,
1074- variables : [ [ "$z" , 5 ] , [ "$foo" , "$z * 2" ] ] ,
1075- crop : "scale" ,
1076- width : "$foo * 200"
1077- } ;
1078- t = cloudinary . utils . generate_transformation_string ( options ) ;
1079- expect ( t ) . to . eql ( "if_fc_gt_2,$z_5,$foo_$z_mul_2,c_scale,w_$foo_mul_200" ) ;
1080- } ) ;
1081- it ( "'$key' should define a variable" , function ( ) {
1082- var options , t ;
1083- options = {
1084- transformation : [
1085- {
1086- $foo : 10
1087- } ,
1088- {
1089- if : "face_count > 2"
1090- } ,
1091- {
1092- crop : "scale" ,
1093- width : "$foo * 200 / face_count"
1094- } ,
1095- {
1096- if : "end"
1097- }
1098- ]
1099- } ;
1100- t = cloudinary . utils . generate_transformation_string ( options ) ;
1101- expect ( t ) . to . eql ( "$foo_10/if_fc_gt_2/c_scale,w_$foo_mul_200_div_fc/if_end" ) ;
1102- } ) ;
1103-
1104- it ( "should not change variable names even if they look like keywords" , function ( ) {
1105- var options , t ;
1106- options = {
1107- transformation : [
1108- {
1109- $width : 10
1110- } ,
1111- {
1112- width : "$width + 10 + width"
1113- }
1114- ]
1115- } ;
1116- t = cloudinary . utils . generate_transformation_string ( options ) ;
1117- expect ( t ) . to . eql ( "$width_10/w_$width_add_10_add_w" ) ;
1118- } ) ;
1119-
1120- it ( "should support text values" , function ( ) {
1121- test_cloudinary_url ( "sample" , {
1122- effect : "$efname:100" ,
1123- $efname : "!blur!"
1124- } , `http://res.cloudinary.com/${ cloud_name } /image/upload/$efname_!blur!,e_$efname:100/sample` , { } ) ;
1125- } ) ;
1126- it ( "should support string interpolation" , function ( ) {
1127- test_cloudinary_url ( "sample" , {
1128- crop : "scale" ,
1129- overlay : {
1130- text : "$(start)Hello $(name)$(ext), $(no ) $( no)$(end)" ,
1131- font_family : "Arial" ,
1132- font_size : "18"
1133- }
1134- } , `http://res.cloudinary.com/${ cloud_name } /image/upload/c_scale,l_text:Arial_18:$(start)Hello%20$(name)$(ext)%252C%20%24%28no%20%29%20%24%28%20no%29$(end)/sample` , { } ) ;
1135- } ) ;
1136- it ( "should support power operator" , function ( ) {
1137- var options , t ;
1138- options = {
1139- transformation : [
1140- {
1141- $small : 150 ,
1142- $big : "$small ^ 1.5"
1143- }
1144- ]
1145- } ;
1146- t = cloudinary . utils . generate_transformation_string ( options ) ;
1147- expect ( t ) . to . eql ( "$big_$small_pow_1.5,$small_150" ) ;
1148- } ) ;
1149- } ) ;
11501060 describe ( "text" , function ( ) {
11511061 this . timeout ( TIMEOUT . MEDIUM ) ;
11521062 var text_encoded , text_layer ;
0 commit comments