/***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('
{{outage.displayId}}
'), 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(); }); });