|
|
@ -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 () { |
|
|
|