diff --git a/package.json b/package.json index 7e06766..ecf2a93 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,12 @@ "react-component" ], "devDependencies": { + "babel": "^5.6.4", "babel-core": "^5.1.11", "babel-loader": "^5.0.0", "jasmine-node": "^1.14.5", - "react": "^0.13.1", "jsdom": "^3.1.2", - "node-jsx": "^0.13.2", + "react": "^0.13.1", "webpack": "^1.7.3", "webpack-dev-server": "^1.7.0" }, diff --git a/specs/Element-spec.jsx b/specs/Element-spec.jsx index 68d7262..d517f37 100644 --- a/specs/Element-spec.jsx +++ b/specs/Element-spec.jsx @@ -543,7 +543,7 @@ it('should allow an undefined value to be updated to a value', function (done) { {this.state.bool ? : - + } ); @@ -555,7 +555,7 @@ it('should allow an undefined value to be updated to a value', function (done) { expect(input.isFormDisabled()).toBe(true); form.flip(); expect(input.isFormDisabled()).toBe(false); - + }); it('should allow for dot notation in name which maps to a deep object', function () { @@ -569,7 +569,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var TestForm = React.createClass({ onSubmit: function (model) { - expect(model).toEqual({foo: {bar: 'foo', test: 'test'}}); + expect(model).toEqual({foo: {bar: 'foo', test: 'test'}}); }, render: function () { return ( @@ -584,7 +584,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var form = TestUtils.renderIntoDocument(); var formEl = TestUtils.findRenderedDOMComponentWithTag(form, 'form'); TestUtils.Simulate.submit(formEl); - + }); }); diff --git a/specs/Rules-equals-spec.jsx b/specs/Rules-equals-spec.jsx index 8928f00..a689b16 100644 --- a/specs/Rules-equals-spec.jsx +++ b/specs/Rules-equals-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: equals', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should pass with a default value', pass()); diff --git a/specs/Rules-isAlpha-spec.jsx b/specs/Rules-isAlpha-spec.jsx index a9171f2..60b7a5e 100644 --- a/specs/Rules-isAlpha-spec.jsx +++ b/specs/Rules-isAlpha-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: isAlpha', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should pass with a default value', pass()); diff --git a/specs/Rules-isEmail-spec.jsx b/specs/Rules-isEmail-spec.jsx index f377434..29e5943 100644 --- a/specs/Rules-isEmail-spec.jsx +++ b/specs/Rules-isEmail-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: isEmail', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should pass with a default value', pass()); diff --git a/specs/Rules-isEmptyString-spec.jsx b/specs/Rules-isEmptyString-spec.jsx index 237d6e0..7fdad83 100644 --- a/specs/Rules-isEmptyString-spec.jsx +++ b/specs/Rules-isEmptyString-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: isEmptyString', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should fail with a default value', fail()); diff --git a/specs/Rules-isExisty-spec.jsx b/specs/Rules-isExisty-spec.jsx index 6991acd..e946b81 100644 --- a/specs/Rules-isExisty-spec.jsx +++ b/specs/Rules-isExisty-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: isExisty', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should fail with a default value', fail()); diff --git a/specs/Rules-isLength-spec.jsx b/specs/Rules-isLength-spec.jsx index 28dd5ca..1e52cc3 100644 --- a/specs/Rules-isLength-spec.jsx +++ b/specs/Rules-isLength-spec.jsx @@ -33,7 +33,7 @@ describe('Rules: isLength', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); describe('isLength:3', function() { diff --git a/specs/Rules-isNumeric-spec.jsx b/specs/Rules-isNumeric-spec.jsx index 3e309bd..94e21fd 100644 --- a/specs/Rules-isNumeric-spec.jsx +++ b/specs/Rules-isNumeric-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: isNumeric', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should pass with a default value', pass()); diff --git a/specs/Rules-isUrl-spec.jsx b/specs/Rules-isUrl-spec.jsx index 3d5ec87..cabf8ac 100644 --- a/specs/Rules-isUrl-spec.jsx +++ b/specs/Rules-isUrl-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: isUrl', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should pass with a default value', pass()); diff --git a/specs/Rules-isWords-spec.jsx b/specs/Rules-isWords-spec.jsx index f9cae81..f7752f4 100644 --- a/specs/Rules-isWords-spec.jsx +++ b/specs/Rules-isWords-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: isWords', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should pass with a default value', pass()); diff --git a/specs/Rules-maxLength-spec.jsx b/specs/Rules-maxLength-spec.jsx index f148cf7..5c00103 100644 --- a/specs/Rules-maxLength-spec.jsx +++ b/specs/Rules-maxLength-spec.jsx @@ -42,7 +42,7 @@ describe('Rules: maxLength', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); it('should pass with a default value', pass()); diff --git a/specs/Rules-minLength-spec.jsx b/specs/Rules-minLength-spec.jsx index 9d8bff1..57b7712 100644 --- a/specs/Rules-minLength-spec.jsx +++ b/specs/Rules-minLength-spec.jsx @@ -33,7 +33,7 @@ describe('Rules: minLength', function() { }); afterEach(function() { - TestInput = isValid = isInvalid = form = null; + TestInput = isValid = form = null; }); describe('minLength:3', function() { diff --git a/src/main.js b/src/main.js index cb2ae47..5059093 100644 --- a/src/main.js +++ b/src/main.js @@ -98,7 +98,7 @@ Formsy.Form = React.createClass({ return this.props.mapping(this.model) } else { return Object.keys(this.model).reduce(function (mappedModel, key) { - + var keyArray = key.split('.'); while (keyArray.length) { var currentKey = keyArray.shift(); @@ -435,12 +435,10 @@ Formsy.Form = React.createClass({ }, render: function () { - return React.DOM.form({ - onSubmit: this.submit, - className: this.props.className, - autoComplete: this.props.autoComplete - }, - this.traverseChildrenAndRegisterInputs(this.props.children) + return ( +
+ {this.traverseChildrenAndRegisterInputs(this.props.children)} +
); } diff --git a/testrunner.js b/testrunner.js index 5289691..48f4251 100644 --- a/testrunner.js +++ b/testrunner.js @@ -1,9 +1,7 @@ -require('node-jsx').install({ - extension: '.jsx' -}); +require('babel/register'); var path = require('path'); -var jsdom = require("jsdom").jsdom; +var jsdom = require('jsdom').jsdom; var jasmine = require('jasmine-node'); global.document = jsdom();