mirror of
https://github.com/nasa/openmct.git
synced 2025-04-09 04:14:32 +00:00
[Fixed Position] Update failing specs
Update existing tests to account for changes from WTD-880.
This commit is contained in:
parent
84e90f6ad1
commit
6814567116
@ -7,6 +7,8 @@ define(
|
||||
|
||||
describe("The Fixed Position controller", function () {
|
||||
var mockScope,
|
||||
mockQ,
|
||||
mockDialogService,
|
||||
mockSubscriber,
|
||||
mockFormatter,
|
||||
mockDomainObject,
|
||||
@ -58,6 +60,11 @@ define(
|
||||
'telemetrySubscriber',
|
||||
[ 'subscribe' ]
|
||||
);
|
||||
mockQ = jasmine.createSpyObj('$q', ['when']);
|
||||
mockDialogService = jasmine.createSpyObj(
|
||||
'dialogService',
|
||||
['getUserInput']
|
||||
);
|
||||
mockFormatter = jasmine.createSpyObj(
|
||||
'telemetryFormatter',
|
||||
[ 'formatDomainValue', 'formatRangeValue' ]
|
||||
@ -99,6 +106,8 @@ define(
|
||||
|
||||
controller = new FixedController(
|
||||
mockScope,
|
||||
mockQ,
|
||||
mockDialogService,
|
||||
mockSubscriber,
|
||||
mockFormatter
|
||||
);
|
||||
|
@ -6,12 +6,28 @@ define(
|
||||
"use strict";
|
||||
|
||||
describe("Fixed Position view's selection proxy", function () {
|
||||
it("has a placeholder message when clicked", function () {
|
||||
var oldAlert = window.alert;
|
||||
window.alert = jasmine.createSpy('alert');
|
||||
new FixedProxy({}).add('');
|
||||
expect(window.alert).toHaveBeenCalledWith(jasmine.any(String));
|
||||
window.alert = oldAlert;
|
||||
var mockCallback,
|
||||
mockQ,
|
||||
mockDialogService,
|
||||
mockPromise,
|
||||
proxy;
|
||||
|
||||
beforeEach(function () {
|
||||
mockCallback = jasmine.createSpy('callback');
|
||||
mockQ = jasmine.createSpyObj('$q', ['when']);
|
||||
mockDialogService = jasmine.createSpyObj('dialogService', ['getUserInput']);
|
||||
mockPromise = jasmine.createSpyObj('promise', ['then']);
|
||||
|
||||
mockQ.when.andReturn(mockPromise);
|
||||
|
||||
proxy = new FixedProxy(mockCallback, mockQ, mockDialogService);
|
||||
});
|
||||
|
||||
it("handles promised element creation", function () {
|
||||
// The element factory may return promises (e.g. if
|
||||
// user input is required) so make sure proxy is wrapping these
|
||||
proxy.add("fixed.box");
|
||||
expect(mockQ.when).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -5,8 +5,13 @@ define(
|
||||
function (ElementProxies) {
|
||||
"use strict";
|
||||
|
||||
// Expect these element types to have proxies
|
||||
var ELEMENT_TYPES = [
|
||||
"fixed.telemetry"
|
||||
"fixed.telemetry",
|
||||
"fixed.line",
|
||||
"fixed.box",
|
||||
"fixed.text",
|
||||
"fixed.image"
|
||||
];
|
||||
|
||||
// Verify that the set of proxies exposed matches the specific
|
||||
|
Loading…
x
Reference in New Issue
Block a user