Skip to content

Commit

Permalink
Added unit test for issue #4921.
Browse files Browse the repository at this point in the history
  • Loading branch information
oysteinmoseng authored and TorsteinHonsi committed May 23, 2017
1 parent 0c8e75c commit e75d04c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
@@ -0,0 +1,7 @@
---
authors:
- Øystein Moseng
resources:
- https://code.jquery.com/qunit/qunit-1.19.0.js
- https://code.jquery.com/qunit/qunit-1.19.0.css
...
@@ -0,0 +1,7 @@
<script src="https://code.highcharts.com/highcharts.js"></script>

<div id="qunit"></div>
<div id="qunit-fixture"></div>


<div id="container" style="width: 600px; margin: 0 auto;"></div>
@@ -0,0 +1,28 @@
$(function () {
QUnit.test('Check that column width takes hidden series into account', function (assert) {
var chart = Highcharts.chart('container', {
chart: {
type: 'column',
ignoreHiddenSeries: false
},
series: [{
name: 'Tokyo',
data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
name: 'Tokyo2',
data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
}),
colWidth = chart.series[0].points[0].pointWidth;

chart.series[0].hide();
chart.series[1].hide();
chart.series[0].show();

assert.strictEqual(
chart.series[0].points[0].pointWidth,
colWidth,
'Columns remain same width as with 2 series visible'
);
});
});

0 comments on commit e75d04c

Please sign in to comment.