From 7d181d215a425f4671072b6898e66fa6f9916a0b Mon Sep 17 00:00:00 2001 From: perry Date: Wed, 14 Jan 2015 17:29:45 -0600 Subject: [PATCH] test(infiniteScroll): Fix unit test for PhantomJS bug Phantom JS bug details: https://github.com/ariya/phantomjs/issues/11289 --- test/unit/angular/directive/infiniteScroll.unit.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/unit/angular/directive/infiniteScroll.unit.js b/test/unit/angular/directive/infiniteScroll.unit.js index 54692c3523..1cfded6455 100644 --- a/test/unit/angular/directive/infiniteScroll.unit.js +++ b/test/unit/angular/directive/infiniteScroll.unit.js @@ -192,8 +192,9 @@ describe('ionicInfiniteScroll directive', function() { expect(el.scope().foo).not.toBe(1); var el = setupNative('on-infinite="foo=1"'); - var scrollEvent = new Event('scroll'); - ctrl.scrollEl.dispatchEvent(scrollEvent); + var evObj = document.createEvent('HTMLEvents'); + evObj.initEvent('scroll', true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null); + ctrl.scrollEl.dispatchEvent(evObj); expect(el.hasClass('active')).toBe(false); expect(ctrl.isLoading).toBe(false);