diff --git a/js/ext/angular/src/directive/ionicTabBar.js b/js/ext/angular/src/directive/ionicTabBar.js index e34b65ffc7c..c5db39f5a12 100644 --- a/js/ext/angular/src/directive/ionicTabBar.js +++ b/js/ext/angular/src/directive/ionicTabBar.js @@ -245,7 +245,7 @@ function($scope, $ionicViewService, $rootScope, $element) { require: ['^ionTabs', '^ionTab'], template: '' + + 'ng-click="selectTab($event)" class="tab-item">' + '{{badge}}' + '' + '' + @@ -273,7 +273,8 @@ function($scope, $ionicViewService, $rootScope, $element) { $scope.isTabActive = function() { return tabsCtrl.selectedTab === tabCtrl.$scope; }; - $scope.selectTab = function() { + $scope.selectTab = function(e) { + e.preventDefault(); tabsCtrl.select(tabCtrl.$scope, true); }; }; diff --git a/test/e2e/viewState/test.js b/test/e2e/viewState/test.js index 117a28e50a5..dd39027be44 100644 --- a/test/e2e/viewState/test.js +++ b/test/e2e/viewState/test.js @@ -1,8 +1,6 @@ -describe('tabs test page', function() { - var P; +describe('viewState', function() { beforeEach(function() { browser.get('http://localhost:8080/test/e2e/viewState/test.html'); - P = protractor.getInstance(); }); function navTitle() { @@ -15,7 +13,6 @@ describe('tabs test page', function() { } it('navbar with multiple histories', function() { - browser.sleep(1000); expect(navTitle().getText()).toBe('Sign-In'); expect(navButtons('back').getAttribute('class')).toContain('hide'); expect(navButtons('left').getText()).toEqual('Home'); @@ -40,7 +37,7 @@ describe('tabs test page', function() { expect(navButtons('left').isPresent()).toBe(false); expect(navButtons('right').isPresent()).toBe(false); - element(by.css('.tabs a.tab-item:nth-child(2)')).click(); + element(by.css('.tabs a:nth-child(2)')).click(); expect(navTitle().getText()).toBe('Add Auto'); expect(navButtons('back').getAttribute('class')).toContain('hide');