Skip to content

Commit

Permalink
Added update to legend test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jszuminski authored and TorsteinHonsi committed Jun 15, 2023
1 parent f43640f commit 24f486d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions samples/unit-tests/legend/layout/demo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
QUnit.test('Legend layout', function (assert) {
var chart = Highcharts.chart('container', {
legend: {
enabled: false,
layout: 'proximate',
align: 'right'
},
Expand Down Expand Up @@ -34,6 +35,13 @@ QUnit.test('Legend layout', function (assert) {
]
});

// We should be able to update the legend.enabled property, #19078.
chart.update({
legend: {
enabled: true
}
});

chart.series.forEach(function (s) {
var y = s.points[2].plotY || s.yAxis.height;

Expand Down Expand Up @@ -102,6 +110,7 @@ QUnit.test('Proximate layout and dataGrouping', assert => {
animation: false
},
legend: {
enabled: true,
align: 'right',
layout: 'proximate'
},
Expand Down Expand Up @@ -135,6 +144,19 @@ QUnit.test('Proximate layout and dataGrouping', assert => {
]
});

// These updates should not cause an error, #19028.
chart.update({
legend: {
enabled: false
}
});

chart.update({
legend: {
enabled: true
}
});

chart.series[1].hide();

// Avoid using strict position as it may vary between browsers
Expand Down

0 comments on commit 24f486d

Please sign in to comment.