Commit 33b38a3c authored by michalkop93's avatar michalkop93

added test.

parent 715c39f1
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -150,6 +150,34 @@ describe('c3 chart axis', function () { ...@@ -150,6 +150,34 @@ describe('c3 chart axis', function () {
}); });
}); });
describe('axis.x.tick.values', function () {
describe('function is provided', function () {
var tickGenerator = function (/*domain*/) {
var values = [];
for (var i = 0; i <= 300; i += 50) {
values.push(i);
}
return values;
};
beforeEach(function () {
args.axis.x = {
tick: {
values: tickGenerator
}
};
chart = window.c3.generate(args);
window.generatedTicks = tickGenerator();
});
it('should use function to generate ticks', function () {
d3.select('.c3-axis-x').selectAll('g.tick').each(function (d, i) {
var tick = d3.select(this).select('text').text();
expect(+tick).toBe(window.generatedTicks[i]);
});
});
});
});
describe('axis.x.tick.width', function () { describe('axis.x.tick.width', function () {
describe('indexed x axis and y/y2 axis', function () { describe('indexed x axis and y/y2 axis', function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment