diff --git a/src/components/refresher/test/refresher.spec.ts b/src/components/refresher/test/refresher.spec.ts index c03429d16e..fda442efdd 100644 --- a/src/components/refresher/test/refresher.spec.ts +++ b/src/components/refresher/test/refresher.spec.ts @@ -91,15 +91,18 @@ describe('Refresher', () => { describe('_onMove', () => { - it('should set scrollElement inline styles when pulling down, but not past threshold', () => { + it('should set scrollElement inline styles when pulling down, but not past threshold', (done) => { setContentScrollTop(0); refresher.startY = 100; refresher.pullMin = 80; refresher._onMove( touchEv(125) ); - expect(getScrollElementStyles().transform).toEqual('translateY(25px) translateZ(0px)'); - expect(getScrollElementStyles().transitionDuration).toEqual('0ms'); - expect(getScrollElementStyles().overflow).toEqual('hidden'); + dom.flush(() => { + expect(getScrollElementStyles().transform).toEqual('translateY(25px) translateZ(0px)'); + expect(getScrollElementStyles().transitionDuration).toEqual('0ms'); + expect(getScrollElementStyles().overflow).toEqual('hidden'); + done(); + }); }); it('should set scrollElement inline styles when pulling up above startY', () => { @@ -126,17 +129,20 @@ describe('Refresher', () => { expect(result).toEqual(7); }); - it('should reset styles when _appliedStyles=true, delta<=0', () => { + it('should reset styles when _appliedStyles=true, delta<=0', (done) => { refresher._appliedStyles = true; refresher.startY = 100; let result = refresher._onMove( touchEv(85) ); - expect(refresher.state).toEqual('inactive'); - expect(getScrollElementStyles().transform).toEqual('translateZ(0px)'); - expect(getScrollElementStyles().transitionDuration).toEqual(''); - expect(getScrollElementStyles().overflow).toEqual(''); - expect(result).toEqual(5); + dom.flush(() => { + expect(refresher.state).toEqual('inactive'); + expect(getScrollElementStyles().transform).toEqual('translateZ(0px)'); + expect(getScrollElementStyles().transitionDuration).toEqual(''); + expect(getScrollElementStyles().overflow).toEqual(''); + expect(result).toEqual(5); + done(); + }); }); it('should not run when scrollTop is > 0', () => {