d3Chart-unit-test: refactored