We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d39d530 + 0883408 commit f2aad66Copy full SHA for f2aad66
test/oauth2.spec.js
@@ -20,6 +20,24 @@ describe('SatellizerOauth2', function() {
20
//this.oauth2.open();
21
});
22
23
+ it('should propagate promise rejections', inject(function($q, SatellizerPopup) {
24
+ var error;
25
+ var message = 'Popup Rejected';
26
+ var defer = $q.defer();
27
+
28
+ spyOn(SatellizerPopup, 'pollPopup').and.returnValue(defer.promise);
29
30
+ this.oauth2.open(this.config.providers.github).catch(function (err) {
31
+ error = err;
32
+ });
33
34
+ defer.reject(message);
35
+ this.$timeout.flush();
36
+ this.$timeout.verifyNoPendingTasks();
37
38
+ expect(error).toEqual(message);
39
+ }));
40
41
42
43
describe('exchangeForToken()', function() {
0 commit comments