Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

define(['carouselService'], function () {
'use strict';

describe('carousel Service', function () {
var service, modalMock;

beforeEach(function () {
module('angularTemplateApp');

modalMock = jasmine.createSpyObj('$modal', ['open']);
module(function ($provide) {
$provide.value('$modal', modalMock);
});

inject(function (carouselService) {
service = carouselService;
});
});

it('should have open modal function', function () {
expect(service.openModal).toBeDefined();
});

it('should open modal with params if function is called', function () {
var modalParams = {
windowTemplateUrl: 'modules/ui-components/modals/helper/modal-window_template.html',
templateUrl: 'modules/applets/home/carousel-tour/carousel_template.html',
controller: 'TourController',
backdrop: 'static',
keyboard: false,
resolve: {
modalInfo: function () {
return {value: null, dismissed: true, resendHash: []};
}
}
};

modalMock.open.and.callFake(function() {
expect(arguments[0].windowTemplateUrl).toEqual(modalParams.windowTemplateUrl);
expect(arguments[0].templateUrl).toEqual(modalParams.templateUrl);
expect(arguments[0].controller).toEqual(modalParams.controller);
expect(arguments[0].backdrop).toEqual(modalParams.backdrop);
expect(arguments[0].keyboard).toEqual(modalParams.keyboard);
});

service.openModal();
});

});
});