close details when changing topologies

fixes #297
This commit is contained in:
David Kaltschmidt
2015-07-14 16:16:09 +02:00
parent c9e74f754d
commit dfd158cceb
2 changed files with 18 additions and 0 deletions

View File

@@ -143,6 +143,23 @@ describe('AppStore', function() {
expect(AppStore.getNodes()).toEqual(NODE_SET);
});
it('closes details when changing topologies', function() {
registeredCallback(ReceiveTopologiesAction);
registeredCallback(ClickTopologyAction);
registeredCallback(ReceiveNodesDeltaAction);
expect(AppStore.getAppState())
.toEqual({"topologyId":"topo1","selectedNodeId": null});
registeredCallback(ClickNodeAction);
expect(AppStore.getAppState())
.toEqual({"topologyId":"topo1","selectedNodeId": 'n1'});
registeredCallback(ClickSubTopologyAction);
expect(AppStore.getAppState())
.toEqual({"topologyId":"topo1-grouped","selectedNodeId": null});
});
// connection errors
it('resets topology on websocket reconnect', function() {

View File

@@ -145,6 +145,7 @@ AppStore.registeredCallback = function(payload) {
break;
case ActionTypes.CLICK_TOPOLOGY:
selectedNodeId = null;
if (payload.topologyId !== currentTopologyId) {
currentTopologyId = payload.topologyId;
nodes = {};