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' });
expect(store.getState()).toBe(1);
let devStoreState = store.devToolsStore.getState();
devStoreState.committedState = 10;
devStoreState.stagedActions[2] = { type: 'INCREMENT' };
let stagedActions = [...store.devToolsStore.getState().stagedActions];
// replace DECREMENT with INCREMENT (stagedAction[0] is @@INIT)
stagedActions[2] = { type: 'INCREMENT' };
const committedState = 10;
devToolsStore.dispatch(ActionCreators.recomputeStates(
devStoreState.committedState,
devStoreState.stagedActions
committedState,
stagedActions
));
expect(store.getState()).toBe(13);