title: How to unit test a method that is dependent on another?
body: <p>I have a React and Redux project I'm trying to unit test with Chai testing framework.  Right now I'm writing a test for a reducer I have, and several of actions this reducer handles call helper methods.  Here is an example:</p>
  
  <p><strong>formsReducer.js:</strong></p>
  
  <pre><code>import * as types from '../constants/actionTypes';
  import objectAssign from 'object-assign';
  import initialState from './initialState';
  import formsHelper from '../utils/FormsHelper';
  export default function formsReducer(state = initialState.forms, action) {
    switch (action.type) {
      case types.UPDATE_PRODUCT: {
          let formBlueprints = formsHelper.getFormsByProductId(action.product.id);
          formBlueprints = formsHelper.addOrRemoveMnDisclosure(formBlueprints, action.stateOfResidence.id);
          return objectAssign({}, state, {blueprints: formBlueprints, instances: []});
      }
    }
  }
  </code></pre>
  
  <p>As you can see, if I test this method I'm dependent on the <code>formsHelper.getFormsByProductId</code> and <code>formsHelper.addOrRemoveMnDisclosure</code> methods to pass as well.  How should I test this reducer/action?  Should I make a separate set of test data that can be returned from these methods when a certain product.id is passed to these methods?</p>