This is my code I have tried many trail and error methods
self.getBasicProfileInformation = function () { var deferred = $q.defer(); skillDashBrdServce.getBasicInformation(userName).then(function (result) { self.basicInformation = result; sessionStorage['userSDOType'] = JSON.stringify(result.SDODomain); sessionStorage['userType'] = JSON.stringify(result.AlignmentType); deferred.resolve(); }); return deferred.promise; }
My test Case is as follows.
it('Should call get Basic Profile Information function', function () {
spyOn($scope, "getBasicProfileInformation").and.callThrough();
var result = $scope.getBasicProfileInformation();
expect($scope.getBasicProfileInformation).toHaveBeenCalled();
});
can you please tell me where I am going wrong.
Aucun commentaire:
Enregistrer un commentaire