describe('Testing calendarBookView', function() { 'use strict'; var $scope, $compile, element, ctrl; beforeEach(function() { module('myitsmApp'); inject(function($rootScope, _$compile_) { $scope = $rootScope.$new(); $compile = _$compile_; }); }); it('ensures callFoo does whatever it is supposed to', function() { var calendarCtrl = { model: { expanded: false, calendarViews: ['book', 'day', 'week', 'month'], showWeekends: true, calendarTypes: [ {id: 'changes', selected: true}, {id: 'outages', selected: true}, {id: 'businessEvents', selected: true} ], context: $scope.context, editMode: $scope.editMode, isNew: $scope.isNew, currentRequestResourceId: "CurrentCRQ", thisCrqSortWeight: 1, collisionCrqSortWeight: 10, collisionOutageSortWeight: 60, collisionBusinessEventSortWeight: 80, addressedCollisions: {}, zoomInDisabled: false, zoomOutDisabled: false } }; element = angular.element(''); element.data('$calendarController', calendarCtrl); $compile(element)($scope); var elementScope = element.find('calendar-book-view').scope(); //need to rewrite calendar-book-view directive to test it, not possible with the current implementation as it requires the parent calendar directive }); });