BenMaruchu / public-web

1 stars 3 forks source link

Refactor redux action unit tests to test action creators and return action #22

Closed BenMaruchu closed 6 years ago

BenMaruchu commented 6 years ago

Test for the whole return object not a single field at a time. I advice to use below format in testing actions creators


it('should create an action to reset service request',() => {
    const expectedAction = { type:types.RESET_SERVICE_REQUEST};

    expect(actions.resetServiceRequest()).toEqual(expectedAction);
});