mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
@@ -60,11 +60,6 @@ describe('AppStore', function() {
|
||||
type: ActionTypes.OPEN_WEBSOCKET
|
||||
};
|
||||
|
||||
const ReceiveEmptyNodesDeltaAction = {
|
||||
type: ActionTypes.RECEIVE_NODES_DELTA,
|
||||
delta: {}
|
||||
};
|
||||
|
||||
const ReceiveNodesDeltaAction = {
|
||||
type: ActionTypes.RECEIVE_NODES_DELTA,
|
||||
delta: {
|
||||
@@ -189,12 +184,12 @@ describe('AppStore', function() {
|
||||
|
||||
registeredCallback(CloseWebsocketAction);
|
||||
expect(AppStore.isWebsocketClosed()).toBeTruthy();
|
||||
// keep showing old nodes
|
||||
expect(AppStore.getNodes().toJS()).toEqual(NODE_SET);
|
||||
|
||||
registeredCallback(OpenWebsocketAction);
|
||||
expect(AppStore.isWebsocketClosed()).toBeFalsy();
|
||||
|
||||
registeredCallback(ReceiveEmptyNodesDeltaAction);
|
||||
// opened socket clears nodes
|
||||
expect(AppStore.getNodes().toJS()).toEqual({});
|
||||
});
|
||||
|
||||
|
||||
@@ -176,7 +176,6 @@ AppStore.registeredCallback = function(payload) {
|
||||
break;
|
||||
|
||||
case ActionTypes.CLOSE_WEBSOCKET:
|
||||
nodes = nodes.clear();
|
||||
websocketClosed = true;
|
||||
AppStore.emit(AppStore.CHANGE_EVENT);
|
||||
break;
|
||||
@@ -209,7 +208,7 @@ AppStore.registeredCallback = function(payload) {
|
||||
|
||||
case ActionTypes.OPEN_WEBSOCKET:
|
||||
// flush nodes cache after re-connect
|
||||
nodes = {};
|
||||
nodes = nodes.clear();
|
||||
websocketClosed = false;
|
||||
|
||||
AppStore.emit(AppStore.CHANGE_EVENT);
|
||||
|
||||
Reference in New Issue
Block a user