32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
JavaScript
/*** Created by nilpatil*/
|
|
describe('Test change-wizard-tab 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('<change-wizard-tab tabid="tabIds.wizard.ci" icon="icon-cube_o" selectedtab="state.selectedWizardTab" valid="formValid(tabIds.wizard.ci)"></change-wizard-tab>'),
|
|
compiledElement = compile(element)(scope);
|
|
|
|
scope.$digest();
|
|
return compiledElement;
|
|
}
|
|
|
|
it('should compile change-wizard-tab directive', function () {
|
|
var directiveElem = getCompiledElement(), divElem = directiveElem[0];
|
|
expect(divElem).toBeDefined();
|
|
});
|
|
}); |