mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 13:18:15 +00:00
[Plot] Add tests
...to verify that data is requeried when user changes domain or range selection.
This commit is contained in:
@ -53,6 +53,14 @@ define(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fireWatch(expr, value) {
|
||||||
|
mockScope.$watch.calls.forEach(function (call) {
|
||||||
|
if (call.args[0] === expr) {
|
||||||
|
call.args[1].apply(null, [value]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockScope = jasmine.createSpyObj(
|
mockScope = jasmine.createSpyObj(
|
||||||
@ -263,6 +271,20 @@ define(
|
|||||||
]);
|
]);
|
||||||
expect(mockHandle.request.calls.length).toEqual(2);
|
expect(mockHandle.request.calls.length).toEqual(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("requeries when user changes domain selection", function () {
|
||||||
|
mockScope.$watch.mostRecentCall.args[1](mockDomainObject);
|
||||||
|
expect(mockHandle.request.calls.length).toEqual(1);
|
||||||
|
fireWatch("axes[0].active.key", 'someNewKey');
|
||||||
|
expect(mockHandle.request.calls.length).toEqual(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("requeries when user changes range selection", function () {
|
||||||
|
mockScope.$watch.mostRecentCall.args[1](mockDomainObject);
|
||||||
|
expect(mockHandle.request.calls.length).toEqual(1);
|
||||||
|
fireWatch("axes[1].active.key", 'someNewKey');
|
||||||
|
expect(mockHandle.request.calls.length).toEqual(2);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user