it('should get the correct pixels for '+test.labels.length+' gridLine(s) for the horizontal scale when offsetGridLines is '+test.offsetGridLines+' and offset is '+test.offset,function(){
varchart=window.acquireChart({
type:'line',
data:{
datasets:[{
data:[]
}],
labels:test.labels
},
options:{
scales:{
xAxes:[{
id:'xScale0',
gridLines:{
offsetGridLines:test.offsetGridLines,
drawTicks:false
},
ticks:{
display:false
},
offset:test.offset
}],
yAxes:[{
display:false
}]
},
legend:{
display:false
}
}
});
varxScale=chart.scales.xScale0;
xScale.ctx=window.createMockContext();
chart.draw();
expect(xScale.ctx.getCalls().filter(function(x){
returnx.name==='moveTo'&&x.args[1]===0;
}).map(function(x){
returnx.args[0];
})).toEqual(test.expected);
});
});
gridLineTests.forEach(function(test){
it('should get the correct pixels for '+test.labels.length+' gridLine(s) for the vertical scale when offsetGridLines is '+test.offsetGridLines+' and offset is '+test.offset,function(){