Merge "Fix Jasmine unit tests"

This commit is contained in:
Jenkins 2016-10-07 09:59:19 +00:00 committed by Gerrit Code Review
commit 83bd7d2fda
2 changed files with 22 additions and 10 deletions

View File

@ -52,9 +52,9 @@
expect(property.propertySet).toBe(propertySet);
expect(property.getSelectOptions()).toBe(null);
expect(property.required).toBe(false);
expect(property.defaultValue).toBe(null);
expect(property.inputValue).toBe(null);
expect(property.getInputValue()).toBe(null);
expect(property.defaultValue).toBe(undefined);
expect(property.inputValue).toBe(undefined);
expect(property.getInputValue()).toBe(undefined);
expect(property.isActive()).toBe(true);
});

View File

@ -28,7 +28,8 @@
}
function createPort(nodeUuid, index, extra) {
var port = {uuid: portUuid(nodeUuid, index)};
var uuid = portUuid(nodeUuid, index);
var port = {uuid: uuid, id: uuid};
if (angular.isDefined(extra)) {
port.extra = extra;
}
@ -36,7 +37,7 @@
}
function createNode(name, uuid) {
return {name: name, uuid: uuid};
return {name: name, uuid: uuid, id: uuid};
}
var ironicAPI = {
@ -61,6 +62,16 @@
ironicAPI);
}));
beforeEach(module(function($provide) {
$provide.value('horizon.framework.widgets.toast.service',
{});
}));
beforeEach(module(function($provide) {
$provide.value('horizon.dashboard.admin.ironic.edit-node.service',
{});
}));
beforeEach(module(function($provide) {
$provide.value('horizon.dashboard.admin.ironic.maintenance.service',
{});
@ -75,7 +86,8 @@
ctrl = controller(
'horizon.dashboard.admin.ironic.NodeDetailsController',
{$location: $location,
{$scope: scope,
$location: $location,
'horizon.dashboard.admin.ironic.actions': {},
'horizon.dashboard.admin.basePath': '/static'});
@ -97,14 +109,14 @@
});
it('should have ports', function () {
expect(ctrl.ports).toBeDefined();
expect(ctrl.ports.length).toEqual(numPorts);
expect(ctrl.portsSrc).toBeDefined();
expect(ctrl.portsSrc.length).toEqual(numPorts);
var ports = [];
for (var i = 0; i < ctrl.ports.length; i++) {
for (var i = 0; i < numPorts; i++) {
ports.push(createPort(ctrl.node.uuid, i));
}
expect(ctrl.ports).toEqual(ports);
expect(ctrl.portsSrc).toEqual(ports);
});
it('should have a uuid regular expression pattern', function () {