Skip to content

Commit b4b862d

Browse files
strausrtocker
authored andcommitted
Add test for user variables
1 parent 914878d commit b4b862d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/TransformationTest.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,16 @@ describe('Transformation', () => {
2929
expect(tag.type()).to.equal("img");
3030
expect(tag.state("url")).to.equal("http://res.cloudinary.com/demo/image/upload/c_scale,w_100/a_30/c_pad,w_200/sample");
3131
});
32+
it("array should define a set of variables", function () {
33+
let tag = shallow(
34+
<Image cloudName='demo'
35+
publicId='sample'
36+
variables={[
37+
["$z", 5], ["$foo", "$z * 2"]
38+
]}
39+
>
40+
</Image>);
41+
expect(tag.type()).to.equal("img");
42+
expect(tag.state("url")).to.equal("http://res.cloudinary.com/demo/image/upload/$z_5,$foo_$z_mul_2/sample");
43+
});
3244
});

0 commit comments

Comments
 (0)