What, actually, is the problem?
React.addons.TestUtils.Simulate.submit() works for me.
If this can help, I was in a similar situation and I am testing the submit handler this way (using sinon.js , mocha and chai ):
var renderDocumentJQuery = $(renderDocument.getDOMNode()) this.xhr = sinon.useFakeXMLHttpRequest(); var requests = this.requests = []; this.xhr.onCreate = function (xhr) { requests.push(xhr); }; renderDocumentJQuery.find('input#person_email').val(' test@email.com '); React.addons.TestUtils.Simulate.submit(renderDocumentJQuery.find('form')[0]); var requestFired = requests[0]; this.xhr.restore(); it('should fire an AJAX with the right params', function(){ assert.equal(requestFired.requestBody,'campaign_id=123&owner_id=456&person%5Bemail%5D=test%40email.com') }); it('should fire an AJAX with a POST method', function(){ assert.equal(requestFired.method,'POST') }); it('should fire an AJAX with the correct url', function(){ assert.equal(requestFired.url,'url-for-testing') });
source share