August 2017
Beginner
374 pages
10h 41m
English
Because the initial state is false (which is also the result of the clearFilter action), we first need to dispatch a setFilter action and ensure the state was changed. Then, we dispatch the clearFilter action and ensure the state is false again:
test('clearFilter action should reset filter state', () => { const category = 'test' state = filterReducer(state, setFilter(category)) expect(state).toBe(category)
const action = clearFilter() state = filterReducer(state, action) ...
Read now
Unlock full access