title: Can I call a method without using .simulate() - Jest Enzyme
body: <p>I'm unit testing for a React flight seat selecting app using Jest/Enzyme. Is there a way I can test a method within my class based component which would run after a button is clicked, but without actually simulating the button click? This is because the button is within a child of a child component and the method is being passed down as a prop.</p>
  
  <p>Albeit a very simple function, I'd still like to test it</p>
  
  <pre><code>inputSeats(chosenSeats) {
      this.setState({
          chosenSeats: chosenSeats
      })
  }
  </code></pre>
  
  <p>This is in a parent component called FlightSeats, with a child of SeatMaps, and SeatMaps has 2 children of SeatMap (inbound/outbound). </p>
  
  <p>Within each of these SeatMap components there is the 'Reserve Seats' button which when clicked it performs some validation tests, calls another method in SeatMap and eventually calls inputSeats() from within SeatMaps component. I'm struggling to simulate the button click since it is deep within the app.</p>
  
  <p>Ideally, in my unit test, I'd just to like to call it with something like</p>
  
  <pre><code>    FlightSeats.inputSeats(chosenSeats)
  </code></pre>
  
  <p>and pass in my mock data as chosenSeats... Or would I have to import the child components and mount them and use .simulate('click') on the button?</p>
  
  <p>My test so far:</p>
  
  <pre><code>let chosenSeats = {
      outbound: [{
          seatNo: "11A",
          seatPrice: "11.11",
  
      }, {
          seatNo: "12A",
          seatPrice: "12.12"
      }],
      inbound: [{
          seatNo: "14A",
          seatPrice: "14.14",
  
      }, {
          seatNo: "15A",
          seatPrice: "15.15"
      }]
  };
  
  let wrapper, buildEmptySeats, clearSeats, comp;
  
  beforeEach(() =&gt; {
              comp = ( &lt; FlightSeats seats = {
                      seatsArr
                  }
                  party = {
                      partyArr
                  }
                  flights = {
                      flightArr
                  }
                  /&gt;);
  
                  wrapper = shallow(comp); component = mount(comp);
              });
  
          test('should handle inputSeats correctly', () =&gt; {
              // what to call here??  
              expect(component.state().chosenSeats.outbound[1].seatNo).toEqual("12A");
              expect(component.state().chosenSeats.outbound[1].seatPrice).toEqual(12.12);
  
          });
  </code></pre>