vis.js is a dynamic, browser-based visualization library
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.
 
 
 

43 lines
1.1 KiB

var assert = require('assert');
var jsdom_global = require('jsdom-global');
var canvasMockify = require('./canvas-mock');
var DataAxis = require('../lib/timeline/component/DataAxis');
describe('DataAxis', function () {
beforeEach(function() {
this.jsdom_global = canvasMockify("<svg id='svg'></svg>");
this.svg = this.container = document.getElementById('svg');
this.body = {
functions: {},
emitter: {
on: function() {}
}
};
});
afterEach(function() {
this.jsdom_global();
this.svg.remove();
this.svg = undefined;
});
it('should work', function () {
var dataAxis = new DataAxis(this.body, {}, this.svg, {});
});
describe('screenToValue', function () {
it('can called be without an explicit redraw', function () {
var dataAxis = new DataAxis(this.body, {}, this.svg, {});
assert(isNaN(dataAxis.screenToValue(77)));
});
});
describe('convertValue', function () {
it('can called be without an explicit redraw', function () {
var dataAxis = new DataAxis(this.body, {}, this.svg, {});
assert(isNaN(dataAxis.convertValue(77)));
});
});
});