From 6a27fef8b5e95ddec3c39abdd5a4bc2b8b01f605 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Sat, 11 Apr 2015 22:08:44 -0500 Subject: [PATCH] chore(tap): fix isKeyboardElement test --- test/unit/angular/directive/keyboardAttach.unit.js | 7 ++++--- test/unit/utils/tap.unit.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/unit/angular/directive/keyboardAttach.unit.js b/test/unit/angular/directive/keyboardAttach.unit.js index 7cc6235612b..c7c07cab5a1 100644 --- a/test/unit/angular/directive/keyboardAttach.unit.js +++ b/test/unit/angular/directive/keyboardAttach.unit.js @@ -1,6 +1,6 @@ describe('keyboardAttach directive', function() { beforeEach(module('ionic')); - + function setup() { var el, content; inject(function($compile, $rootScope) { @@ -12,7 +12,7 @@ describe('keyboardAttach directive', function() { }); return {el: el, content: content}; } - + it('should move up when window fires native.showkeyboard event', function() { var el = setup().el; ionic.Platform.isFullScreen = true; @@ -38,13 +38,14 @@ describe('keyboardAttach directive', function() { it('should do nothing if Android and not fullscreen', function() { var el = setup().el; + ionic.Platform.setPlatform('android'); ionic.Platform.isFullScreen = false; expect(el.css('bottom')).toEqual(''); ionic.trigger('native.showkeyboard', { target: window, keyboardHeight: 33 }); expect(el.css('bottom')).toEqual(''); el.scope().$destroy(); }); - + it('should remove listeners on destroy', function() { spyOn(ionic, 'off'); var el = setup().el; diff --git a/test/unit/utils/tap.unit.js b/test/unit/utils/tap.unit.js index c508613b864..ad53d4d2e71 100644 --- a/test/unit/utils/tap.unit.js +++ b/test/unit/utils/tap.unit.js @@ -94,6 +94,8 @@ describe('Ionic Tap', function() { deregisterTap = ionic.tap.register(document.createElement('div')); ionic.scroll = { isScrolling: false }; + ionic.Platform.setPlatform(null); + ionic.Platform._checkPlatforms(); }); afterEach(function(){ @@ -1270,7 +1272,6 @@ describe('Ionic Tap', function() { expect( ionic.tap.isKeyboardElement(null) ).toEqual(false); ionic.Platform.setPlatform('ios'); - ionic.Platform.ua = 'iPhone'; var ele = document.createElement('input'); ele.type = 'date';