Add tests for `removeLegend()` and `showLegend()`