30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
/***Created by nilpatil*/
|
|
describe('Test change-popover-title directive', function () {
|
|
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());
|
|
compile = $compile;
|
|
scope = $rootScope.$new();
|
|
});
|
|
});
|
|
|
|
function getCompiledElement() {
|
|
var element = angular.element('<div class="change-popover-title clearfix"><div class="display-id">{{outage.displayId}}</div>'), compiledElement = compile(element)(scope);
|
|
scope.$digest();
|
|
return compiledElement;
|
|
}
|
|
|
|
it('should compile change-popover-title directive', function () {
|
|
var directiveElem = getCompiledElement(), divElem = directiveElem[0];
|
|
expect(divElem).toBeDefined();
|
|
});
|
|
}); |