Skip to content

Commit

Permalink
chore(tap): fix isKeyboardElement test
Browse files Browse the repository at this point in the history
  • Loading branch information
tlancina committed Apr 12, 2015
1 parent 018b49f commit 6a27fef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions test/unit/angular/directive/keyboardAttach.unit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('keyboardAttach directive', function() {
beforeEach(module('ionic'));

function setup() {
var el, content;
inject(function($compile, $rootScope) {
Expand All @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion test/unit/utils/tap.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 6a27fef

Please sign in to comment.