780 lines
30 KiB
JavaScript
780 lines
30 KiB
JavaScript
describe("AssetEditStatusController", function () {
|
|
var modalInstance;
|
|
|
|
beforeEach(module('myitsmApp'));
|
|
beforeEach(inject(function ($injector, $rootScope, $controller, assetModel, metadataModel, $q, systemAlertService, $filter, events, i18nService) {
|
|
this.scope = $rootScope.$new();
|
|
this.assetModel = assetModel;
|
|
this.metadataModel = metadataModel;
|
|
this.$q = $q;
|
|
this.systemAlertService = systemAlertService;
|
|
this.$filter = $filter;
|
|
this.events = events;
|
|
this.i18nService = i18nService;
|
|
|
|
modalInstance = {
|
|
close: jasmine.createSpy('modalInstance.close'),
|
|
dismiss: jasmine.createSpy('modalInstance.dismiss'),
|
|
result: {
|
|
then: jasmine.createSpy('modalInstance.result.then')
|
|
}
|
|
};
|
|
|
|
this.createController = function () {
|
|
return $controller('AssetEditStatusController', {
|
|
$scope: this.scope,
|
|
$modalInstance: modalInstance
|
|
});
|
|
};
|
|
|
|
this.controller = this.createController();
|
|
}));
|
|
|
|
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/asset/details/%5Bobject%20Object%5D/%5Bobject%20Object%5D').respond(200);
|
|
$httpBackend.whenGET('/smartit/rest/v2/metadata?type=asset').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);
|
|
$httpBackend.whenGET('components/system-alert/system-alert-modal.html').respond(200);
|
|
}));
|
|
|
|
beforeEach(inject(function ($q, $rootScope) {
|
|
var deferred = $q.defer();
|
|
var success = {
|
|
"name": "AssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetA",
|
|
"desc": "AssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAssetAsset",
|
|
"company": {
|
|
"name": "Calbro Services"
|
|
},
|
|
"product": {
|
|
"categorizations": [
|
|
{
|
|
"name": "product",
|
|
"tiers": {}
|
|
}
|
|
]
|
|
},
|
|
"reconciliationId": "OI-33A6BDC34C974B9B818230C678972C63",
|
|
"assetClassId": "BMC_COMPUTERSYSTEM",
|
|
"assetId": "1122333",
|
|
"instanceId": "OI-F964883D24244B9986CA5BFE557043AB",
|
|
"site": {},
|
|
"status": {
|
|
"value": "Deployed"
|
|
},
|
|
"type": "Computer System",
|
|
"subType": "BMC_COMPUTERSYSTEM",
|
|
"lifecycleDates": {
|
|
"installationDate": 1506070861000,
|
|
"modifiedDate": 1506070864000
|
|
},
|
|
"needsReconciliation": true
|
|
};
|
|
var meta = {
|
|
"statuses": [
|
|
{
|
|
"isValidForCreate": true,
|
|
"index": 0,
|
|
"name": "Ordered",
|
|
"label": "Ordered"
|
|
},
|
|
{
|
|
"isValidForCreate": true,
|
|
"index": 1,
|
|
"name": "Received",
|
|
"label": "Received"
|
|
},
|
|
{
|
|
"isValidForCreate": true,
|
|
"index": 2,
|
|
"name": "Being Assembled",
|
|
"label": "Being Assembled"
|
|
},
|
|
{
|
|
"validStatusTransitions": [
|
|
"In Repair",
|
|
"Down"
|
|
],
|
|
"isValidForCreate": true,
|
|
"index": 3,
|
|
"name": "Deployed",
|
|
"label": "Deployed"
|
|
},
|
|
{
|
|
"validStatusTransitions": [
|
|
"Deployed"
|
|
],
|
|
"isValidForCreate": true,
|
|
"index": 4,
|
|
"name": "In Repair",
|
|
"label": "In Repair"
|
|
},
|
|
{
|
|
"statusReasons": [
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 2000,
|
|
"name": "Maintenance",
|
|
"label": "Maintenance"
|
|
},
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 3000,
|
|
"name": "Out of Service",
|
|
"label": "Out of Service"
|
|
},
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 1000,
|
|
"name": "Scheduled",
|
|
"label": "Scheduled"
|
|
}
|
|
],
|
|
"validStatusTransitions": [
|
|
"In Repair",
|
|
"Deployed"
|
|
],
|
|
"isValidForCreate": true,
|
|
"index": 5,
|
|
"name": "Down",
|
|
"label": "Down"
|
|
},
|
|
{
|
|
"statusReasons": [
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 4000,
|
|
"name": "Obsolete",
|
|
"label": "Obsolete"
|
|
}
|
|
],
|
|
"isValidForCreate": true,
|
|
"index": 6,
|
|
"name": "End of Life",
|
|
"label": "End of Life"
|
|
},
|
|
{
|
|
"isValidForCreate": true,
|
|
"index": 7,
|
|
"name": "Transferred",
|
|
"label": "Transferred"
|
|
},
|
|
{
|
|
"statusReasons": [
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 4000,
|
|
"name": "Obsolete",
|
|
"label": "Obsolete"
|
|
}
|
|
],
|
|
"isValidForCreate": true,
|
|
"index": 8,
|
|
"name": "Delete",
|
|
"label": "Delete"
|
|
},
|
|
{
|
|
"isValidForCreate": true,
|
|
"index": 9,
|
|
"name": "In Inventory",
|
|
"label": "In Inventory"
|
|
},
|
|
{
|
|
"isValidForCreate": true,
|
|
"index": 10,
|
|
"name": "On Loan",
|
|
"label": "On Loan"
|
|
},
|
|
{
|
|
"statusReasons": [
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 4000,
|
|
"name": "Obsolete",
|
|
"label": "Obsolete"
|
|
}
|
|
],
|
|
"isValidForCreate": true,
|
|
"index": 11,
|
|
"name": "Disposed",
|
|
"label": "Disposed"
|
|
},
|
|
{
|
|
"isValidForCreate": true,
|
|
"index": 12,
|
|
"name": "Reserved",
|
|
"label": "Reserved"
|
|
},
|
|
{
|
|
"statusReasons": [
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 6000,
|
|
"name": "RMA - Return To Distributor",
|
|
"label": "RMA - Return To Distributor"
|
|
},
|
|
{
|
|
"displayOrder": 0,
|
|
"index": 5000,
|
|
"name": "RMA - Return To Vendor",
|
|
"label": "RMA - Return To Vendor"
|
|
}
|
|
],
|
|
"isValidForCreate": true,
|
|
"index": 13,
|
|
"name": "Return to Vendor",
|
|
"label": "Return to Vendor"
|
|
}
|
|
],
|
|
"assetTypes": [
|
|
{
|
|
"subType": [
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_COMPUTERSYSTEM",
|
|
"label": "Computer System"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_MAINFRAME",
|
|
"label": "Mainframe"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_PRINTER",
|
|
"label": "Printer"
|
|
}
|
|
],
|
|
"index": 0,
|
|
"name": "Computer System",
|
|
"label": "Computer System"
|
|
},
|
|
{
|
|
"subType": [
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_EQUIPMENT",
|
|
"label": "Equipment"
|
|
}
|
|
],
|
|
"index": 0,
|
|
"name": "Equipment",
|
|
"label": "Equipment"
|
|
},
|
|
{
|
|
"subType": [
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_PROTOCOLENDPOINT",
|
|
"label": "Protocol Endpoint"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_NTDOMAIN",
|
|
"label": "NT Domain"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_CONNECTIVITYGROUP",
|
|
"label": "Connectivity Collection"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_CONNECTIVITYSEGMENT",
|
|
"label": "Connectivity Segment"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_IPCONNECTIVITYSUBNET",
|
|
"label": "IP Connectivity Subnet"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_IPXCONNECTIVITYNETWORK",
|
|
"label": "IPX Connectivity Network"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_LNSGROUP",
|
|
"label": "LNs Collection"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_NETWORKPORT",
|
|
"label": "Network Port"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_LAN",
|
|
"label": "Local Area Network (LAN)"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_WAN",
|
|
"label": "Wide Area Network (WAN)"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_COMMUNICATIONENDPOINT",
|
|
"label": "Communication Endpoint"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_IPENDPOINT",
|
|
"label": "IP Endpoint"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_LANENDPOINT",
|
|
"label": "LAN Endpoint"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_ADMINDOMAIN",
|
|
"label": "Admin Domain"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_CLUSTER",
|
|
"label": "Cluster"
|
|
}
|
|
],
|
|
"index": 0,
|
|
"name": "Network",
|
|
"label": "Network"
|
|
},
|
|
{
|
|
"subType": [
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_BUSINESSSERVICE",
|
|
"label": "Business Service"
|
|
}
|
|
],
|
|
"index": 0,
|
|
"name": "Business Service",
|
|
"label": "Business Service"
|
|
},
|
|
{
|
|
"subType": [
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_APPLICATION",
|
|
"label": "Application"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_OPERATINGSYSTEM",
|
|
"label": "Operating System"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_APPLICATIONINFRASTRUCTURE",
|
|
"label": "Application Infrastructure"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_DATABASE",
|
|
"label": "Database"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_DISKPARTITION",
|
|
"label": "Disk Partition"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_FILESYSTEM",
|
|
"label": "File System"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_SHARE",
|
|
"label": "Share"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC.CORE:BMC_RASD",
|
|
"label": "Resource Allocation Setting Data"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC.CORE:BMC_VIRTUALSYSTEMSETTINGDATA",
|
|
"label": "Virtual System Setting Data"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_PATCH",
|
|
"label": "Patch"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_PRODUCT",
|
|
"label": "Product"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_APPLICATIONSYSTEM",
|
|
"label": "Application System"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_APPLICATIONSERVICE",
|
|
"label": "Application Service"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_BIOS",
|
|
"label": "BIOS Element"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_SOFTWARESERVER",
|
|
"label": "Software Server"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_SYSTEMSOFTWARE",
|
|
"label": "System Software"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_VIRTUALSYSTEMENABLER",
|
|
"label": "Virtual System Enabler"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_PACKAGE",
|
|
"label": "Package"
|
|
}
|
|
],
|
|
"index": 0,
|
|
"name": "Software",
|
|
"label": "Software"
|
|
},
|
|
{
|
|
"subType": [
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_DATABASESTORAGE",
|
|
"label": "Database Storage"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_LOCALFILESYSTEM",
|
|
"label": "Local File System"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_REMOTEFILESYSTEM",
|
|
"label": "Remote File System"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_CARD",
|
|
"label": "Card"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_CHASSIS",
|
|
"label": "Chassis"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_RACK",
|
|
"label": "Rack"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_HARDWAREPACKAGE",
|
|
"label": "Hardware Package"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_KEYBOARD",
|
|
"label": "Keyboard"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_MEDIA",
|
|
"label": "Media"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_MEMORY",
|
|
"label": "Memory"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_MONITOR",
|
|
"label": "Monitor"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_POINTINGDEVICE",
|
|
"label": "Pointing Device"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_PROCESSOR",
|
|
"label": "Processor"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_UPS",
|
|
"label": "UPS"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_SYSTEMRESOURCE",
|
|
"label": "System Resource"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC.CORE:BMC_RESOURCEPOOL",
|
|
"label": "Resource Pool"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_CDROMDRIVE",
|
|
"label": "CDROM Drive"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_DISKDRIVE",
|
|
"label": "Disk Drive"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_FLOPPYDRIVE",
|
|
"label": "Floppy Drive"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_TAPEDRIVE",
|
|
"label": "Tape Drive"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_HARDWARESYSTEMCOMPONENT",
|
|
"label": "Hardware System Component"
|
|
}
|
|
],
|
|
"index": 0,
|
|
"name": "Hardware",
|
|
"label": "Hardware"
|
|
},
|
|
{
|
|
"subType": [
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC.CORE:BMC_BUSINESSPROCESS",
|
|
"label": "Business Process"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_TRANSACTION",
|
|
"label": "Transaction"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_DOCUMENT",
|
|
"label": "Document"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_ACCOUNT",
|
|
"label": "Account"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_ACTIVITY",
|
|
"label": "Activity"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_PHYSICALLOCATION",
|
|
"label": "Physical Location"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_ROLE",
|
|
"label": "Role"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC.CORE:BMC_CONCRETECOLLECTION",
|
|
"label": "Concrete Collection"
|
|
},
|
|
{
|
|
"putIntoInventory": true,
|
|
"index": 0,
|
|
"name": "BMC_LOGICALSYSTEMCOMPONENT",
|
|
"label": "Logical System Component"
|
|
},
|
|
{
|
|
"putIntoInventory": false,
|
|
"index": 0,
|
|
"name": "BMC_SERVICEOFFERINGINSTANCE",
|
|
"label": "Service Offering Instance"
|
|
}
|
|
],
|
|
"index": 0,
|
|
"name": "Other",
|
|
"label": "Other"
|
|
}
|
|
],
|
|
};
|
|
|
|
spyOn(this.assetModel, "getAssetDetailsByID").and.callFake(function () {
|
|
deferred.resolve(success);
|
|
return deferred.promise;
|
|
});
|
|
|
|
spyOn(this.metadataModel, "getMetadataByType").and.callFake(function () {
|
|
deferred.resolve(meta);
|
|
return deferred.promise;
|
|
});
|
|
|
|
spyOn(this.assetModel, "update").and.callFake(function () {
|
|
deferred.resolve(success);
|
|
return deferred.promise;
|
|
});
|
|
|
|
spyOn(this.assetModel, "updateCacheAssetDetails").and.callFake(function () {
|
|
deferred.resolve(success);
|
|
return deferred.promise;
|
|
});
|
|
|
|
spyOn(this.systemAlertService, "warning").and.callFake(function () {
|
|
deferred.resolve(success);
|
|
return deferred.promise;
|
|
});
|
|
}));
|
|
|
|
it('should defined', function () {
|
|
expect(this.controller).toBeDefined();
|
|
this.scope.$apply();
|
|
});
|
|
|
|
it('should run changeStatus ()', function () {
|
|
this.status = 'recevied';
|
|
this.scope.state.isDirty = true;
|
|
this.scope.changeStatus(this.status);
|
|
this.scope.$apply();
|
|
});
|
|
|
|
it('should broadcast MODAL_BACKDROP_CLICK and assign asset data', inject(function ($rootScope) {
|
|
handleModalBackdropClick = function () {
|
|
return
|
|
}
|
|
$rootScope.$broadcast(this.events.MODAL_BACKDROP_CLICK, handleModalBackdropClick);
|
|
this.scope.$apply();
|
|
}));
|
|
|
|
it('should run changeStatusReason ()', function () {
|
|
this.statusReason = 'test foo';
|
|
this.scope.changeStatusReason(this.statusReason);
|
|
expect(this.scope.selected.statusReason).toEqual('test foo');
|
|
this.scope.$apply();
|
|
});
|
|
|
|
it('should run isSaveButtonDisabled ()', function () {
|
|
this.myResult = this.scope.isSaveButtonDisabled();
|
|
expect(this.myResult).toBe(true);
|
|
this.scope.selected.status = 'test fooo';
|
|
this.myResult = this.scope.isSaveButtonDisabled();
|
|
expect(this.myResult).toBe(false);
|
|
});
|
|
|
|
it('should run submit ()', function () {
|
|
expect(this.scope.state.updatingStatus).toBe(false);
|
|
this.scope.submit();
|
|
expect(this.scope.state.updatingStatus).toBe(true);
|
|
this.scope.$apply();
|
|
expect(this.scope.state.updatingStatus).toBe(false);
|
|
});
|
|
|
|
it('should run close ()', function () {
|
|
this.scope.state.isDirty = true;
|
|
this.scope.close();
|
|
this.scope.$apply();
|
|
});
|
|
});
|