|
|
@ -8,10 +8,7 @@ describe('c3 chart', function () { |
|
|
|
|
|
|
|
|
|
|
|
var chart, d3; |
|
|
|
var chart, d3; |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(function () { |
|
|
|
var args = { |
|
|
|
window.initDom(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chart = window.c3.generate({ |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
columns: [ |
|
|
|
columns: [ |
|
|
|
['data1', 30, 200, 100, 400, 150, 250], |
|
|
|
['data1', 30, 200, 100, 400, 150, 250], |
|
|
@ -19,16 +16,34 @@ describe('c3 chart', function () { |
|
|
|
['data3', 150, 120, 110, 140, 115, 125] |
|
|
|
['data3', 150, 120, 110, 140, 115, 125] |
|
|
|
] |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
beforeEach(function (done) { |
|
|
|
|
|
|
|
chart = window.initChart(chart, args, done); |
|
|
|
d3 = chart.internal.d3; |
|
|
|
d3 = chart.internal.d3; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('init', function () { |
|
|
|
|
|
|
|
|
|
|
|
it('should be created', function () { |
|
|
|
it('should be created', function () { |
|
|
|
var svg = d3.select('#chart svg'); |
|
|
|
var svg = d3.select('#chart svg'); |
|
|
|
expect(svg).not.toBeNull(); |
|
|
|
expect(svg).not.toBeNull(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('should set 3rd party property to Function', function () { |
|
|
|
|
|
|
|
Function.prototype.$extIsFunction = true; |
|
|
|
|
|
|
|
expect(true).toBeTruthy(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('should be created even if 3rd party property has been set', function () { |
|
|
|
|
|
|
|
var svg = d3.select('#chart svg'); |
|
|
|
|
|
|
|
expect(svg).not.toBeNull(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('size', function () { |
|
|
|
|
|
|
|
|
|
|
|
it('should have same width', function () { |
|
|
|
it('should have same width', function () { |
|
|
|
var svg = d3.select('#chart svg'); |
|
|
|
var svg = d3.select('#chart svg'); |
|
|
|
expect(+svg.attr('width')).toBe(640); |
|
|
|
expect(+svg.attr('width')).toBe(640); |
|
|
@ -40,3 +55,5 @@ describe('c3 chart', function () { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|