Merge branch 'mobile-integration' into open-master

This commit is contained in:
Pete Richards
2015-09-22 13:53:22 -07:00
90 changed files with 4235 additions and 1637 deletions

View File

@@ -19,7 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/*global define,describe,it,expect,beforeEach,jasmine*/
define(
["../../src/controllers/TreeNodeController"],
@@ -29,6 +29,7 @@ define(
describe("The tree node controller", function () {
var mockScope,
mockTimeout,
mockDomainObject,
controller;
function TestObject(id, context) {
@@ -41,8 +42,13 @@ define(
}
beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", ["$watch", "$on"]);
mockScope = jasmine.createSpyObj("$scope", ["$watch", "$on", "$emit"]);
mockTimeout = jasmine.createSpy("$timeout");
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getCapability", "getModel", "useCapability" ]
);
controller = new TreeNodeController(mockScope, mockTimeout);
});
@@ -183,6 +189,22 @@ define(
expect(controller.isSelected()).toBeFalsy();
});
it("exposes selected objects in scope", function () {
mockScope.domainObject = mockDomainObject;
mockScope.ngModel = {};
controller.select();
expect(mockScope.ngModel.selectedObject)
.toEqual(mockDomainObject);
});
it("invokes optional callbacks upon selection", function () {
mockScope.parameters =
{ callback: jasmine.createSpy('callback') };
controller.select();
expect(mockScope.parameters.callback).toHaveBeenCalled();
});
});
}
);
);

View File

@@ -91,7 +91,7 @@ define(
it("get url for a new tab using domainObject and mode", function () {
urlService.urlForNewTab(mockMode, mockDomainObject);
});
});
});
}
);

View File

@@ -15,4 +15,4 @@
"directives/MCTScroll",
"services/UrlService",
"StyleSheetLoader"
]
]