Merge pull request #1429 from etimberg/feature/unit-test

Linear scale tests
This commit is contained in:
Evert Timberg 2015-08-31 20:44:27 -04:00
commit f9eb8b141e
3 changed files with 914 additions and 69 deletions

View File

@ -329,16 +329,6 @@
return this.getPixelForValue(value);
}
var offset = 0;
for (var j = datasetIndex; j < this.data.datasets.length; j++) {
if (j === datasetIndex && value) {
offset += value;
} else {
offset = offset + value;
}
}
return this.getPixelForValue(value);
},

View File

@ -68,7 +68,12 @@
clearRect: function() {},
closePath: function() {},
fill: function() {},
fillText: function() {},
lineTo: function(x, y) {},
measureText: function(text) {
// return the number of characters * fixed size
return text ? { width: text.length * 10 } : {width: 0};
},
moveTo: function(x, y) {},
quadraticCurveTo: function() {},
restore: function() {},
@ -82,7 +87,7 @@
var addMethod = function(name, method) {
scope[methodName] = function() {
scope.record(name, arguments);
method.apply(scope, arguments);
return method.apply(scope, arguments);
};
}
@ -104,6 +109,10 @@
return this._calls;
}
Context.prototype.resetCalls = function() {
this._calls = [];
};
window.createMockContext = function() {
return new Context();
};

File diff suppressed because it is too large Load Diff