Testing angularJS functionalities