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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.