mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 23:53:49 +00:00
[Layout] Deselect object after removal
If the selected object is not in the composition, deselect it. Add tests. Fixes #1731
This commit is contained in:
@ -424,6 +424,17 @@ define(
|
||||
expect(selectedObj.showFrame).toEqual(jasmine.any(Function));
|
||||
});
|
||||
|
||||
it("deselects the object that is no longer in the composition", function () {
|
||||
mockScope.$watchCollection.mostRecentCall.args[1]();
|
||||
var childObj = mockCompositionObjects[0];
|
||||
controller.select(mockEvent, childObj.getId());
|
||||
|
||||
var composition = ["b", "c"];
|
||||
mockScope.$watchCollection.mostRecentCall.args[1](composition);
|
||||
|
||||
expect(controller.selected(childObj)).toBe(false);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user