From 5f2b499fabbc49bc05de905a7ad8fe0ee15136dc Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 5 Mar 2015 09:56:16 -0700 Subject: [PATCH] test(): fix tests on safari --- test/unit/angular/directive/sideMenu.unit.js | 4 ++-- test/unit/utils/tap.unit.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/unit/angular/directive/sideMenu.unit.js b/test/unit/angular/directive/sideMenu.unit.js index 0810662d25..60c2cd1d10 100644 --- a/test/unit/angular/directive/sideMenu.unit.js +++ b/test/unit/angular/directive/sideMenu.unit.js @@ -77,10 +77,10 @@ describe('Ionic Angular Side Menu', function() { sideMenuController.exposeAside(true); expect(content.offsetX).toEqual(275); expect(content.getTranslateX()).toEqual(0); - expect(content.element.getAttribute('style').indexOf('translate3d(275px, 0px, 0px)') > -1).toEqual(true); + expect(content.element.getAttribute('style')).toMatch(/translate3d\(275px, 0(px)?, 0(px)?/); expect(content.element.style.width).toNotEqual(''); sideMenuController.exposeAside(false); - expect(content.element.getAttribute('style').indexOf('translate3d(0px, 0px, 0px)') > -1).toEqual(true); + expect(content.element.getAttribute('style')).toMatch(/translate3d\(0(px)?, 0(px)?, 0(px)?/); expect(content.getTranslateX()).toEqual(0); expect(content.offsetX).toEqual(0); expect(content.element.style.width).toEqual(''); diff --git a/test/unit/utils/tap.unit.js b/test/unit/utils/tap.unit.js index 960f370bb5..716cbaad4a 100644 --- a/test/unit/utils/tap.unit.js +++ b/test/unit/utils/tap.unit.js @@ -1230,7 +1230,7 @@ describe('Ionic Tap', function() { it('Should isDateInput', function() { expect( ionic.tap.isDateInput(null) ).toEqual(false); - ele = document.createElement('input'); + ele = { tagName: 'INPUT' }; ele.type = 'date'; expect( ionic.tap.isDateInput(ele) ).toEqual(true); @@ -1256,7 +1256,6 @@ describe('Ionic Tap', function() { ele.type = 'text'; expect( ionic.tap.isDateInput(ele) ).toEqual(false); - }); it('Should isLabelWithTextInput', function() {