96 lines
3.3 KiB
JavaScript
96 lines
3.3 KiB
JavaScript
/*** Created by vdhakre .*/
|
|
describe('PrintController', function () {
|
|
|
|
beforeEach(module('myitsmApp'));
|
|
beforeEach(inject(function ($rootScope, $controller, events, $state) {
|
|
var modalInstance = {
|
|
close: jasmine.createSpy('modalInstance.close'),
|
|
dismiss: jasmine.createSpy('modalInstance.dismiss'),
|
|
result: {
|
|
then: jasmine.createSpy('modalInstance.result.then')
|
|
}
|
|
};
|
|
this.scope = $rootScope.$new();
|
|
this.controller = $controller;
|
|
this.events = events;
|
|
this.$state = $state;
|
|
|
|
var asset = {
|
|
"name": "BMC Remedy Action Request System 8.1",
|
|
"desc": "BMC Remedy Action Request System 8.1 documentation.\nhttps://docs.bmc.com/docs/display/public/ars81/Home",
|
|
"company": {
|
|
"name": "Petramco"
|
|
},
|
|
"reconciliationId": "REHAA5V0HGXSUAN8ULLOAFQMUE5K1A",
|
|
"classId": "BMC_DOCUMENT",
|
|
"assetId": "DOC000000000001",
|
|
"instanceId": "ASHAA5V0HGXSUAN8ULLNAFQMMR5K0Y",
|
|
"site": {},
|
|
"status": {
|
|
"value": "Deployed"
|
|
},
|
|
"assetExtension": null,
|
|
"type": "Other",
|
|
"subType": "BMC_DOCUMENT",
|
|
"needsReconciliation": false,
|
|
"manufacturer": "BMC Software, Inc.",
|
|
"impact": null,
|
|
"urgency": null,
|
|
"priority": null,
|
|
"version": null,
|
|
"owner": {},
|
|
"ticketType": "asset",
|
|
"extensionAttrs": {},
|
|
"domainAttrs": {},
|
|
"productAttrs": {},
|
|
"poiInfo": {},
|
|
"following": false,
|
|
"assetType": "Other",
|
|
"customFields": {
|
|
"acquiredMethod": 0,
|
|
"scheduleType": 0,
|
|
"documenttype": "vhj",
|
|
"priority": 0,
|
|
"documentdate": 1524649935000,
|
|
"supported": 0
|
|
},
|
|
"bcmDeviceId": null,
|
|
"isPoi": false,
|
|
"outageResourceAvailable": 1,
|
|
"feed": [],
|
|
"attachments": [],
|
|
"noCategories": 1,
|
|
"typeLabel": "Other",
|
|
"subTypeLabel": "Document",
|
|
"notes": "",
|
|
"verified": false
|
|
}
|
|
|
|
this.controllerInstance = this.controller('PrintController', {
|
|
$scope: this.scope,
|
|
$modalInstance: modalInstance,
|
|
params: {
|
|
entity: asset,
|
|
feed: asset.feed
|
|
}
|
|
});
|
|
}));
|
|
|
|
beforeEach(inject(function ($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=global').respond(200);
|
|
$httpBackend.whenGET('/smartit/rest/serverstates').respond(200);
|
|
$httpBackend.whenGET('/smartit/rest/sessionstatus?getLicenseKey=true').respond(200);
|
|
$httpBackend.whenGET('views/dashboard/index.html').respond(200);
|
|
}));
|
|
|
|
it('should defined', function () {
|
|
expect(this.controllerInstance).toBeDefined();
|
|
});
|
|
});
|