step 6 exercise

This commit is contained in:
Ken
2019-02-19 22:20:09 -08:00
parent 2b41788cc2
commit 72ace4f43c
12 changed files with 39 additions and 159 deletions

View File

@@ -1,10 +1,20 @@
import { createStore } from 'redux';
import { reducer } from '.';
import { actions } from '../actions';
describe('reducers', () => {
it('should listen to addTodo message', () => {
const store = createStoreWithDevTool(reducer, {});
console.log(store.getState());
store.dispatch(actions.addTodo('hello'));
store.dispatch(actions.addTodo('world'));
it('should add items', () => {
// 1. use Redux's createStore() to create a store with reducer as argument
// along with the initial state
//
// 2. call store.dispatch() with some action messages to indicate the kind of
// action to perform (in this case, addTodo)
//
// 3. assert with expect() on the resultant store.getState().todos
});
// Tests left for you to do:
// - remove
// - clear
// - complete
});