Test for tab bar controller

This commit is contained in:
Max Lynch
2013-09-13 09:48:48 -05:00
parent a05f9064ad
commit cad4d9b0d5
6 changed files with 112 additions and 55 deletions

View File

@ -2,8 +2,9 @@ describe('TabBarController', function() {
var ctrl;
beforeEach(function() {
var tabEl = $('<div class="tabs"></div>');
ctrl = new TabBarController({
tabBar: new TabBar()
tabBar: new TabBar({ el: tabEl })
});
})
@ -53,8 +54,9 @@ describe('TabBarController', function() {
});
it('Should allow cancelling Controller switch', function() {
var tabEl = $('<div class="tabs"></div>');
ctrl = new TabBarController({
tabBar: new TabBar(),
tabBar: new TabBar({ el: tabEl }),
controllerWillChange: function(Controller) { return false; }
});
@ -70,4 +72,4 @@ describe('TabBarController', function() {
expect(ctrl.getSelectedController()).toBe(ctrl.getController(0));
});
})
})