unit tests for legend.js partially