Browse Source

added test.

pull/747/head
michalkop93 10 years ago
parent
commit
33b38a3c3a
  1. 11
      c3.min.js
  2. 28
      spec/axis-spec.js

11
c3.min.js vendored

File diff suppressed because one or more lines are too long

28
spec/axis-spec.js

@ -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('indexed x axis and y/y2 axis', function () {

Loading…
Cancel
Save