refactoring tests to narrow down to spying on call to d3