56 lines
1.8 KiB
JavaScript
56 lines
1.8 KiB
JavaScript
describe('Test change popover content directive', function () {
|
|
'use strict';
|
|
|
|
var scope,
|
|
compile,
|
|
$httpBackend;
|
|
|
|
beforeEach(module('myitsmApp', 'templates', 'changeModule'));
|
|
beforeEach(function () {
|
|
inject(function ($compile, $rootScope, $injector) {
|
|
$httpBackend = $injector.get('$httpBackend');
|
|
|
|
var getLocale = function () {
|
|
return readJSON('scripts/app/i18n/resources-locale_en.json');
|
|
};
|
|
|
|
$httpBackend.whenGET(/^scripts\/app\/i18n\/resources-locale_en.*$/).respond(getLocale());
|
|
$httpBackend.whenGET('/smartit/rest/v2/metadata?type=change').respond(200);
|
|
|
|
compile = $compile;
|
|
scope = $rootScope.$new();
|
|
scope.changeRequest = {
|
|
"displayId":"CRQ91",
|
|
"title":"Asset_New1788",
|
|
"type":"change",
|
|
"additionalInformation":{
|
|
"assignee":{
|
|
"fullName":"asset_user1 m asset_user1",
|
|
"customFields":{},
|
|
"id":"asset_user1"
|
|
},
|
|
"status":{
|
|
"value":"Draft"
|
|
},
|
|
"priority":"Low",
|
|
"manager":{
|
|
"customFields":{}
|
|
}
|
|
}
|
|
};
|
|
});
|
|
});
|
|
|
|
function getCompiledElement() {
|
|
var element = angular.element('<change-popover-content></change-popover-content>'),
|
|
compiledElement = compile(element)(scope);
|
|
scope.$digest();
|
|
return compiledElement;
|
|
}
|
|
|
|
it('should compile change popover content directive', function () {
|
|
var directiveElem = getCompiledElement(),
|
|
divElem = directiveElem[0];
|
|
expect(divElem).toBeDefined();
|
|
});
|
|
}); |