You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
torque/test/torque.js

30 lines
804 B

var torque = require('../lib/torque/core');
QUnit.module('torque');
test('gets metadata from cartocss', function() {
var STYLE = [
"Map { ",
" buffer-size: 1;",
" -torque-frame-count: 1;",
" -torque-resolution: 2;",
" -torque-animation-duration: 31;",
" -torque-aggregation-function: 'avg(cartodb_id)';",
" -torque-time-attribute: 'time';",
" -torque-data-aggregation: 'cumulative';",
"}",
"#layer { ",
" polygon-fill: #FFF;",
"}"
].join('\n');
var opts = torque.common.TorqueLayer.optionsFromCartoCSS(STYLE);
equal(opts['buffer-size'], 1);
equal(opts['steps'], 1);
equal(opts['resolution'], 2);
equal(opts['animationDuration'], 31);
equal(opts['countby'], 'avg(cartodb_id)');
equal(opts['column'],'time');
equal(opts['data_aggregation'], 'cumulative');
})