SmartIT_Extensions/BMC/smart-it-full/test/app/change/calendar-month-view-directi...

48 lines
1.7 KiB
JavaScript

describe('Testing calendarMonthView', 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('<div><calendar-month-view id="calendarMonthView" viewType="Month"></calendar-month-view></div>');
element.data('$calendarController', calendarCtrl);
$compile(element)($scope);
var elementScope = element.find('calendar-month-view').scope();
//need to rewrite calendar-month-view directive to test it, not possible with the current implementation as it requires the parent calendar directive
});
});