Browse Source

Fix spec

pull/1014/merge
Masayuki Tanaka 10 years ago
parent
commit
c6e719ac7d
  1. 1
      spec/c3-helper.js
  2. 44
      spec/data-spec.js

1
spec/c3-helper.js

@ -34,6 +34,7 @@ function initChart(chart, args, done) {
window.d3 = chart.internal.d3; window.d3 = chart.internal.d3;
window.d3.select('.jasmine_html-reporter') window.d3.select('.jasmine_html-reporter')
.style('position', 'absolute') .style('position', 'absolute')
.style('width', '640px')
.style('right', 0); .style('right', 0);
} }

44
spec/data-spec.js

@ -1,26 +1,29 @@
describe('c3 chart data', function () { describe('c3 chart data', function () {
'use strict'; 'use strict';
var chart; var chart, args;
var args = {
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25],
['data3', 150, 120, 110, 140, 115, 125]
],
order: function () {
return 0;
}
}
};
beforeEach(function (done) { beforeEach(function (done) {
chart = window.initChart(chart, args, done); chart = window.initChart(chart, args, done);
}); });
describe('function in data.order', function () { describe('function in data.order', function () {
it('should update args', function () {
args = {
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25],
['data3', 150, 120, 110, 140, 115, 125]
],
order: function () {
return 0;
}
}
};
expect(true).toBeTruthy();
});
it('should return false in isOrderAsc and isOrderDesc functions', function () { it('should return false in isOrderAsc and isOrderDesc functions', function () {
expect(chart.internal.isOrderAsc() || chart.internal.isOrderDesc()).toBe(false); expect(chart.internal.isOrderAsc() || chart.internal.isOrderDesc()).toBe(false);
}); });
@ -28,6 +31,19 @@ describe('c3 chart data', function () {
describe('data.xs', function () { describe('data.xs', function () {
it('should update args', function () {
args = {
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25],
['data3', 150, 120, 110, 140, 115, 125]
],
}
};
expect(true).toBeTruthy();
});
describe('normal x', function () { describe('normal x', function () {
it('should have correct number of xs for each', function () { it('should have correct number of xs for each', function () {

Loading…
Cancel
Save