From 597fa051833ca3df6eb185c0143ff82e02dacba1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Sep 2017 01:35:13 +0200 Subject: push plugin ugh --- .../phonegap-plugin-push/spec/index.spec.js | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js') diff --git a/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js b/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js index 8e1c2665..e41accd2 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js +++ b/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js @@ -193,7 +193,7 @@ describe('phonegap-plugin-push', function () { push.off('notification', eventHandler); - expect(push._handlers.notification.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.notification.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -208,7 +208,7 @@ describe('phonegap-plugin-push', function () { push.off('registration', eventHandler); - expect(push._handlers.registration.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.registration.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -222,7 +222,7 @@ describe('phonegap-plugin-push', function () { push.on('error', eventHandler); push.off('error', eventHandler); - expect(push._handlers.error.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.error.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -233,19 +233,19 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.registration.length).toEqual(0); + expect(push.handlers.registration.length).toEqual(0); push.on('registration',eventHandler); - expect(push._handlers.registration.length).toEqual(1); - expect(push._handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.registration.length).toEqual(1); + expect(push.handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.registration.length).toEqual(0); - expect(push._handlers.registration.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.registration.length).toEqual(0); + expect(push.handlers.registration.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -255,19 +255,19 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.notification.length).toEqual(0); + expect(push.handlers.notification.length).toEqual(0); push.on('notification', eventHandler); - expect(push._handlers.notification.length).toEqual(1); - expect(push._handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.notification.length).toEqual(1); + expect(push.handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.notification.length).toEqual(0); - expect(push._handlers.notification.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.notification.length).toEqual(0); + expect(push.handlers.notification.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -277,19 +277,19 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.error.length).toEqual(0); + expect(push.handlers.error.length).toEqual(0); push.on('error', eventHandler); - expect(push._handlers.error.length).toEqual(1); - expect(push._handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.error.length).toEqual(1); + expect(push.handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.error.length).toEqual(0); - expect(push._handlers.error.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.error.length).toEqual(0); + expect(push.handlers.error.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -301,21 +301,21 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.registration.length).toEqual(0); + expect(push.handlers.registration.length).toEqual(0); push.on('registration',eventHandler); - expect(push._handlers.registration.length).toEqual(1); - expect(push._handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.registration.length).toEqual(1); + expect(push.handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.registration.length).toEqual(1); - expect(push._handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.registration.length).toEqual(1); + expect(push.handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); done(); - }, null, ['foo', 'bar']); + }, function() {}, ['foo', 'bar']); }); it('should not clear "notification" event handlers', function (done) { @@ -323,21 +323,21 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.notification.length).toEqual(0); + expect(push.handlers.notification.length).toEqual(0); push.on('notification', eventHandler); - expect(push._handlers.notification.length).toEqual(1); - expect(push._handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.notification.length).toEqual(1); + expect(push.handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.notification.length).toEqual(1); - expect(push._handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.notification.length).toEqual(1); + expect(push.handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); done(); - }, null, ['foo', 'bar']); + }, function() {}, ['foo', 'bar']); }); it('should not clear "error" event handlers', function (done) { @@ -345,21 +345,21 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.error.length).toEqual(0); + expect(push.handlers.error.length).toEqual(0); push.on('error', eventHandler); - expect(push._handlers.error.length).toEqual(1); - expect(push._handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.error.length).toEqual(1); + expect(push.handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.error.length).toEqual(1); - expect(push._handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.error.length).toEqual(1); + expect(push.handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); done(); - }, null, ['foo', 'bar']); + }, function() {}, ['foo', 'bar']); }); }); -- cgit v1.2.3-70-g09d2