Add test for getlegend