{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/14028","repository_url":"https://api.github.com/repos/angular/angular.js","labels_url":"https://api.github.com/repos/angular/angular.js/issues/14028/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/14028/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/14028/events","html_url":"https://github.com/angular/angular.js/issues/14028","id":133375802,"number":14028,"title":"$q.when(value)'s promise does not get resolved when manually trigger a digest cycle from tests","user":{"login":"yklee1013","id":3489963,"avatar_url":"https://avatars.githubusercontent.com/u/3489963?v=3","gravatar_id":"","url":"https://api.github.com/users/yklee1013","html_url":"https://github.com/yklee1013","followers_url":"https://api.github.com/users/yklee1013/followers","following_url":"https://api.github.com/users/yklee1013/following{/other_user}","gists_url":"https://api.github.com/users/yklee1013/gists{/gist_id}","starred_url":"https://api.github.com/users/yklee1013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yklee1013/subscriptions","organizations_url":"https://api.github.com/users/yklee1013/orgs","repos_url":"https://api.github.com/users/yklee1013/repos","events_url":"https://api.github.com/users/yklee1013/events{/privacy}","received_events_url":"https://api.github.com/users/yklee1013/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-13T00:15:27Z","updated_at":"2016-02-13T14:37:07Z","closed_at":null,"body":"I'm using Jasmine/Karma to test an angular app, the function I'm testing looks something like this:\r\n\r\n```\r\nfunction foo() : ng.IPromise<SomeInterface>{\r\n  var promise : ng.IPromise<SomeInterface> = returnedFromSomeAPI();\r\n   return promise.then((data : SomeInterface) => {\r\n           return this.$q.when(data.someAttribute);\r\n    })\r\n}\r\n```\r\n\r\nMy test triggers $rootscope.$apply() right after calling foo(), but for some reason the promise inside of \"this.$q.when(data.someAttribute);\" does not get resolved with value. I tried triggering two digest cycles right after(one for promise.then and another for resolving promise inside of when()), but it still didn't work. \r\n\r\nI'm using Angular.js 1.3. Is this a bug?"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/183678323","html_url":"https://github.com/angular/angular.js/issues/14028#issuecomment-183678323","issue_url":"https://api.github.com/repos/angular/angular.js/issues/14028","id":183678323,"user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"created_at":"2016-02-13T14:37:07Z","updated_at":"2016-02-13T14:37:07Z","body":"I couldn't reproduce it on `v1.3.0`. Could it be that `returnedFromSomeAPI()` does not return a `$q` promise or that it is rejected (not resolved) ?\r\n\r\nIf not, please post a live reproduction (e.g. using CodePen, Plnkr etc)."}}