Skip to content

Commit 6a27fef

Browse files
committed
chore(tap): fix isKeyboardElement test
1 parent 018b49f commit 6a27fef

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: test/unit/angular/directive/keyboardAttach.unit.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('keyboardAttach directive', function() {
22
beforeEach(module('ionic'));
3-
3+
44
function setup() {
55
var el, content;
66
inject(function($compile, $rootScope) {
@@ -12,7 +12,7 @@ describe('keyboardAttach directive', function() {
1212
});
1313
return {el: el, content: content};
1414
}
15-
15+
1616
it('should move up when window fires native.showkeyboard event', function() {
1717
var el = setup().el;
1818
ionic.Platform.isFullScreen = true;
@@ -38,13 +38,14 @@ describe('keyboardAttach directive', function() {
3838

3939
it('should do nothing if Android and not fullscreen', function() {
4040
var el = setup().el;
41+
ionic.Platform.setPlatform('android');
4142
ionic.Platform.isFullScreen = false;
4243
expect(el.css('bottom')).toEqual('');
4344
ionic.trigger('native.showkeyboard', { target: window, keyboardHeight: 33 });
4445
expect(el.css('bottom')).toEqual('');
4546
el.scope().$destroy();
4647
});
47-
48+
4849
it('should remove listeners on destroy', function() {
4950
spyOn(ionic, 'off');
5051
var el = setup().el;

Diff for: test/unit/utils/tap.unit.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ describe('Ionic Tap', function() {
9494

9595
deregisterTap = ionic.tap.register(document.createElement('div'));
9696
ionic.scroll = { isScrolling: false };
97+
ionic.Platform.setPlatform(null);
98+
ionic.Platform._checkPlatforms();
9799
});
98100

99101
afterEach(function(){
@@ -1270,7 +1272,6 @@ describe('Ionic Tap', function() {
12701272
expect( ionic.tap.isKeyboardElement(null) ).toEqual(false);
12711273

12721274
ionic.Platform.setPlatform('ios');
1273-
ionic.Platform.ua = 'iPhone';
12741275

12751276
var ele = document.createElement('input');
12761277
ele.type = 'date';

0 commit comments

Comments
 (0)