Skip to content

Commit

Permalink
Fix refreshController unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliy-bobrov committed Apr 28, 2016
1 parent 41e4e31 commit 529ca54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit/angular/controller/refreshController.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('$ionicRefresh Controller', function() {
setup();

function getTy(el) {
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translate3d(0, ', ''));
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translate3d(0px, ', ''));
}

ctrl.__handleTouchmove(evt(0));
Expand All @@ -68,14 +68,14 @@ describe('$ionicRefresh Controller', function() {
ctrl.__handleTouchmove(evt(10));
expect(refresher.classList.contains('invisible')).toBe(false);
ctrl.__handleTouchmove(evt(0));
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translate3d(0, 0px, 0)');
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translate3d(0px, 0px, 0px)');
expect(ctrl.__getScrollChild().classList.contains('overscroll')).toBe(false);
expect(refresher.classList.contains('invisible')).toBe(true);
});

it('should activate and deactivate when dragging past activation threshold', function() {
function getTy(el) {
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translate3d(0, ', ''));
return parseInt(el.style[ionic.CSS.TRANSFORM].replace('translate3d(0px, ', ''));
}
setup();
var domMethods = ctrl.getRefresherDomMethods();
Expand All @@ -92,7 +92,7 @@ describe('$ionicRefresh Controller', function() {

ctrl.__handleTouchmove(evt(0));
timeout.flush();
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translate3d(0, 0px, 0)');
expect(ctrl.__getScrollChild().style[ionic.CSS.TRANSFORM]).toBe('translate3d(0px, 0px, 0px)');
expect(ctrl.__getScrollChild().classList.contains('overscroll')).toBe(false);
expect(refresher.classList.contains('invisible')).toBe(true);
expect(refresher.classList.contains('active')).toBe(false);
Expand Down

0 comments on commit 529ca54

Please sign in to comment.