clarify recompute test

This commit is contained in:
Lee Bannard 2015-09-24 18:12:24 +01:00
parent 7ef89c29e9
commit d157963ceb

View File

@ -153,13 +153,14 @@ describe('devTools', () => {
store.dispatch({ type: 'INCREMENT' }); store.dispatch({ type: 'INCREMENT' });
expect(store.getState()).toBe(1); expect(store.getState()).toBe(1);
let devStoreState = store.devToolsStore.getState(); let stagedActions = [...store.devToolsStore.getState().stagedActions];
devStoreState.committedState = 10; // replace DECREMENT with INCREMENT (stagedAction[0] is @@INIT)
devStoreState.stagedActions[2] = { type: 'INCREMENT' }; stagedActions[2] = { type: 'INCREMENT' };
const committedState = 10;
devToolsStore.dispatch(ActionCreators.recomputeStates( devToolsStore.dispatch(ActionCreators.recomputeStates(
devStoreState.committedState, committedState,
devStoreState.stagedActions stagedActions
)); ));
expect(store.getState()).toBe(13); expect(store.getState()).toBe(13);