mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 04:38:15 +00:00
[Plot] #638 Added a new plot options example bundle and rebased
Fixed jsdoc Fixed incorrect memberof declaration Corrected memberof statement
This commit is contained in:
73
platform/features/plot/test/PlotOptionsFormSpec.js
Normal file
73
platform/features/plot/test/PlotOptionsFormSpec.js
Normal file
@ -0,0 +1,73 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global define,describe,it,expect,beforeEach,jasmine,xit*/
|
||||
|
||||
define(
|
||||
['../src/PlotOptionsForm'],
|
||||
function (PlotOptionsForm) {
|
||||
"use strict";
|
||||
|
||||
describe("The Plot Options form", function () {
|
||||
var plotOptionsForm,
|
||||
mockTopicFunction,
|
||||
mockTopicObject,
|
||||
listener;
|
||||
|
||||
beforeEach(function () {
|
||||
|
||||
mockTopicObject = jasmine.createSpyObj('Topic', [
|
||||
'listen',
|
||||
'notify'
|
||||
]);
|
||||
mockTopicFunction = function() {
|
||||
return mockTopicObject;
|
||||
};
|
||||
|
||||
plotOptionsForm = new PlotOptionsForm(mockTopicFunction);
|
||||
});
|
||||
|
||||
it("defines form specs for x-axis, y-axis, and series data", function () {
|
||||
expect(plotOptionsForm.xAxisForm).toBeDefined();
|
||||
expect(plotOptionsForm.xAxisForm.sections).toBeDefined();
|
||||
expect(plotOptionsForm.xAxisForm.sections[0].rows).toBeDefined();
|
||||
expect(plotOptionsForm.xAxisForm.sections[0].rows.length).toBeGreaterThan(0);
|
||||
|
||||
expect(plotOptionsForm.yAxisForm).toBeDefined();
|
||||
expect(plotOptionsForm.plotSeriesForm).toBeDefined();
|
||||
});
|
||||
|
||||
it("uses a topic to register listeners and inform them when a" +
|
||||
" form value changes", function () {
|
||||
var changedValue = 'changedValue';
|
||||
|
||||
expect(plotOptionsForm.xAxisForm.sections[0].rows[0].onchange).toBeDefined();
|
||||
|
||||
plotOptionsForm.listen(listener);
|
||||
expect(mockTopicObject.listen).toHaveBeenCalledWith(listener);
|
||||
|
||||
plotOptionsForm.xAxisForm.sections[0].rows[0].onchange(changedValue);
|
||||
expect(mockTopicObject.notify).toHaveBeenCalledWith(changedValue);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user