add test for legend