mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 04:38:15 +00:00
[Plot] Switched to $watchCollection on form model
This commit is contained in:
@ -28,21 +28,11 @@ define(
|
||||
|
||||
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);
|
||||
plotOptionsForm = new PlotOptionsForm();
|
||||
});
|
||||
|
||||
it("defines form specs for x-axis, y-axis, and series data", function () {
|
||||
@ -55,19 +45,6 @@ define(
|
||||
expect(plotOptionsForm.plotSeriesForm).toBeDefined();
|
||||
});
|
||||
|
||||
it("uses a topic to register a listener and inform them when a" +
|
||||
" form value changes", function () {
|
||||
var changedValue = 'changedValue';
|
||||
|
||||
expect(plotOptionsForm.xAxisForm.onchange).toBeDefined();
|
||||
|
||||
plotOptionsForm.listen(listener);
|
||||
expect(mockTopicObject.listen).toHaveBeenCalledWith(listener);
|
||||
|
||||
plotOptionsForm.xAxisForm.onchange(changedValue);
|
||||
expect(mockTopicObject.notify).toHaveBeenCalledWith(changedValue);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user