The Get Speaker reducer

To handle the actions related to getting a speaker, we must create two reducers. The first reducer is extremely similar to the reducer we made for the get speakers actions. The second is going to need to be slightly different and is for handling the error case.

Let's begin with the simplest of the two and create the speaker reducer.

describe('Speaker Reducer', () => {     it('exists', () => {       expect(speakerReducer).to.exist;     }); });

Our typical existence test is easily passed.

export function speakerReducer() { }

The next test ensures that the reducer updates state properly, and will close out the tests needed for this reducer.

it('gets a speaker', () => {   // arrange const initialState = { id: '', firstName: '', lastName: ...

Get Practical Test-Driven Development using C# 7 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.