describe('ionNavButtons directive', function() {
beforeEach(module('ionic', function($compileProvider) {
$compileProvider.directive('needsScroll', function() {
return {
//Test if the buttons are 'children of ionScroll' when compiled
require: '^$ionicScroll',
link: function(scope, element, attrs, ctrl) {
element.data('scrollCtrl', ctrl);
}
};
});
}));
beforeEach(function() {
ionic.requestAnimationFrame = function(cb) { cb(); };
});
function setup(side, tpl) {
var el;
inject(function($compile, $rootScope) {
el = $compile('
' +
'' +
'' +
'' +
'' +
(tpl || '') +
'' +
'' +
'' +
'
')($rootScope.$new());
$rootScope.$apply();
});
return el;
}
it('should add buttons to left side by default', function() {
var el = setup(null, '