Testing - React stateless components, spying on component methods using sinon


I am trying to test the click function of a React stateless component in ES6. However, when using sinon to spy on the handleClick function I get the response...

TypeError: Cannot read property 'goToFullCart' of undefined

I have tried a few other methods. Some of them seem to work when the component is a Class component but all methods seem to fail when using a stateless functional component as follows...

The code:

import React from 'react'
import PropTypes from 'prop-types'
import SVG from '../../../../static/svg/Svg';
import Svgs from '../../../../static/svg/SvgTemplates';

const TestComponent = ({order, router}) => {

  const handleClick = (event) => {

  return (
    <button className="preview-bar" onClick={handleClick}>
      <p>Button Content</p>

TestComponent.propTypes = {
  order: PropTypes.object.isRequired,
  router: PropTypes.object.isRequired,

export default TestComponent
export { TestComponent }

import React from 'react';
import { shallow, mount } from 'enzyme';
import { expect } from 'chai';
import sinon from 'sinon';

import TestComponent from "./TestComponent"

let wrapper, props;

describe('<TestComponent /> component unit tests', () => {

  describe('when the minimized cart is clicked', () => {

    beforeEach(function() {
      props = {

      wrapper = shallow((<TestComponent {...props} />))

    it('should have a goToFullCart method', () => {
      const spy = sinon.spy(TestComponent.prototype, 'handleClick');

I am at a loss as to how to spy on the handleClick method to check when the button is clicked.

Thanks for the help and discussion. Feel free to ask for any clarification if anything is not clear.