Skip to content

Commit

Permalink
Tests: Moved issue-test #4536 to unit-tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sigrunnu committed Jun 25, 2019
1 parent d53ea2c commit da8c6da
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 66 deletions.

This file was deleted.

This file was deleted.

55 changes: 0 additions & 55 deletions samples/issues/highcharts-4.1.8/4536-zoom-in-left-category/demo.js

This file was deleted.

54 changes: 54 additions & 0 deletions samples/unit-tests/chart/zoomtype/demo.js
@@ -1,3 +1,57 @@
QUnit.test("Zooming too tight on left category should show full category.(#4536)", function (assert) {
var chart = $('#container').highcharts({
chart: {
type: 'column'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
minRange: 0.99
},

series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
}, {
data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
}]
}).highcharts();

assert.strictEqual(
chart.xAxis[0].min,
0,
"Starting min"
);
assert.strictEqual(
chart.xAxis[0].max,
11,
"Starting max"
);


chart.xAxis[0].setExtremes(0, 0.5);
assert.strictEqual(
chart.xAxis[0].min,
0,
"Ending min"
);
assert.strictEqual(
chart.xAxis[0].max,
0.99,
"Ending max"
);
assert.strictEqual(
typeof chart.xAxis[0].minPixelPadding,
'number',
"Category padding is a number"
);
assert.strictEqual(
chart.xAxis[0].minPixelPadding > 0,
true,
"Category padding is more than 0"
);
});

/* global TestController */
QUnit.test('Zoom type', function (assert) {

Expand Down

0 comments on commit da8c6da

Please sign in to comment.