mirror of
https://github.com/nasa/openmct.git
synced 2025-03-22 03:55:31 +00:00
[Forms] Add placeholder spec
Add placeholder spec for SelectorController, WTD-987.
This commit is contained in:
parent
1efe80f12b
commit
e411e67c81
@ -0,0 +1,45 @@
|
||||
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
define(
|
||||
["../../src/controllers/SelectorController"],
|
||||
function (SelectorController) {
|
||||
"use strict";
|
||||
|
||||
describe("The controller for the 'selector' control", function () {
|
||||
var mockObjectService,
|
||||
mockScope,
|
||||
controller;
|
||||
|
||||
function promiseOf(v) {
|
||||
return (v || {}).then ? v : {
|
||||
then: function (callback) {
|
||||
return promiseOf(callback(v));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
mockObjectService = jasmine.createSpyObj(
|
||||
'objectService',
|
||||
['getObjects']
|
||||
);
|
||||
mockScope = jasmine.createSpyObj(
|
||||
'$scope',
|
||||
['$watch', '$watchCollection']
|
||||
);
|
||||
|
||||
mockObjectService.getObjects.andReturn(promiseOf({}));
|
||||
|
||||
controller = new SelectorController(
|
||||
mockObjectService,
|
||||
mockScope
|
||||
);
|
||||
});
|
||||
|
||||
it("loads the root object", function () {
|
||||
expect(mockObjectService.getObjects)
|
||||
.toHaveBeenCalledWith(["ROOT"]);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
@ -4,6 +4,7 @@
|
||||
"controllers/ClickAwayController",
|
||||
"controllers/ContextMenuController",
|
||||
"controllers/GetterSetterController",
|
||||
"controllers/SelectorController",
|
||||
"controllers/SplitPaneController",
|
||||
"controllers/ToggleController",
|
||||
"controllers/TreeNodeController",
|
||||
|
Loading…
x
Reference in New Issue
Block a user