add unit tests for js controllers