Closed ulilicht closed 9 years ago
Thank you for pointing out this function. I added this feature and the corresponding size options to ensure that the current state of the chart is always represented in the options.
The Idea of your test was totally right, just replace directiveScope
with elementScope
and use $scope
for the outer elementScope
:
it('- Chart should be resized when called.', function () {
// setup spys
spyOn(elementScope.chart, 'resize');
// set option
var size = {
width: 300,
heigth: 100
};
$scope.options.resize(size);
// check configuration change
expect(elementScope.configuration.size).toBe(size);
expect(elementScope.chart.resize).toHaveBeenCalled();
});
I will add a .editorconfig
file later, which will define the indentation and provides plugins for all major editor: http://editorconfig.org/
Hi Max,
I'd like to expose the resize() function from c3; I need to call it when resizing the div which contains the chart but not resizing the window itself.
Unfortunately, I could not figure out how to test this functionality. I don't know how to get the "chart" property of the directive in the test. If I could, I would maybe test it like this:
describe('. resize', function () { it('- Resize on chart should be callable from outside.', function () {
}); Where directiveScope is the scope of the directive and elementScope is the scope of outside.
Something else: Unfortunately, it seems that indentation of my changes are not correct. Can you tell me, how to use your project style in Webstorm/PHPStorm?