/** * Test the side menu directive. For more test coverage of the side menu, * see the core Ionic sideMenu controller tests. */ describe('Ionic Angular Slide Box', function() { var el, delegate, timeout; beforeEach(module('ionic')); beforeEach(inject(function($compile, $rootScope, $timeout, SlideBoxDelegate) { delegate = SlideBoxDelegate; timeout = $timeout; el = $compile('\ \
\

BLUE {{slideBox.slideIndex}}

\
\
\ \
\

YELLOW {{slideBox.slideIndex}}

\
\
\ \

PINK {{slideBox.slideIndex}}

\
\
')($rootScope); })); it('Should init', function() { var scope = el.scope(); expect(scope.slideBox).not.toBe(undefined); }); it('Should update with delegate', function() { var scope = el.scope(); var slideBox = scope.slideBox; spyOn(slideBox, 'setup'); delegate.update(); timeout.flush(); expect(slideBox.setup).toHaveBeenCalled(); }); });