only updateLegend when we actually want to show the legend for the first time
adding a test to make sure the new updateLegend behaviour works