Javascript Test under AngularJS framework