From bd03e0c45495aa6ae4037546d4b624186acb9f62 Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Thu, 8 Jan 2015 17:30:49 +0100 Subject: [PATCH] adds basic test for marker-files --- test/rendering_js.test.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/rendering_js.test.js b/test/rendering_js.test.js index 61d5800..a6ae419 100644 --- a/test/rendering_js.test.js +++ b/test/rendering_js.test.js @@ -74,6 +74,35 @@ describe('RenderingJS', function() { assert(layer0.getSymbolizers()[1] === 'line'); }); + it ("should return list of marker-files", function(){ + var css = [ + 'Map {', + '-torque-time-attribute: "date";', + '-torque-aggregation-function: "count(cartodb_id)";', + '-torque-frame-count: 760;', + '-torque-animation-duration: 15;', + '-torque-resolution: 2', + '}', + '#layer {', + ' marker-width: 3;', + ' marker-fill-opacity: 0.8;', + ' marker-fill: #FEE391; ', + ' marker-file: url(http://localhost:8081/gal.svg); ', + ' comp-op: "lighten";', + ' [value > 2] { marker-file: url(http://upload.wikimedia.org/wikipedia/commons/4/43/Flag_of_the_Galactic_Empire.svg); }', + ' [value > 3] { marker-file: url(http://upload.wikimedia.org/wikipedia/commons/c/c9/Flag_of_Syldavia.svg); }', + ' [frame-offset = 1] { marker-width: 10; marker-fill-opacity: 0.05;}', + ' [frame-offset = 2] { marker-width: 15; marker-fill-opacity: 0.02;}', + '}' + ].join('\n'); + var shader = (new carto.RendererJS({ debug: true })).render(css); + var markerURLs = shader.getImageURLs(); + var against = ["http://localhost:8081/gal.svg", "http://upload.wikimedia.org/wikipedia/commons/4/43/Flag_of_the_Galactic_Empire.svg", "http://upload.wikimedia.org/wikipedia/commons/c/c9/Flag_of_Syldavia.svg"]; + for(var i = 0; i