Fixed #40 with test

This commit is contained in:
Max Lynch
2013-10-29 14:27:54 -05:00
parent 01bbf5c1fa
commit 082259dcfb
7 changed files with 65 additions and 8 deletions

View File

@ -36,6 +36,28 @@ describe('Tab Bar Controller', function() {
expect(ctrl.getSelectedControllerIndex()).toEqual(1);
});
it('Calls change callback', function() {
scope.onControllerChanged = function(oldC, oldI, newC, newI) {
};
// Add a controller
ctrl.add({
title: 'Cats',
icon: 'icon-kitty-kat'
});
ctrl.add({
title: 'Dogs',
icon: 'icon-rufus'
});
spyOn(ctrl, 'controllerChanged');
expect(ctrl.getSelectedControllerIndex()).toEqual(0);
ctrl.select(1);
expect(ctrl.controllerChanged).toHaveBeenCalled();
});
});
describe('Tab Bar directive', function() {