Fix tests

This commit is contained in:
Semigradsky 2015-06-23 12:55:12 +03:00
parent c37c053a66
commit 9db2b9fccf
14 changed files with 19 additions and 21 deletions

View File

@ -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"
},

View File

@ -543,7 +543,7 @@ it('should allow an undefined value to be updated to a value', function (done) {
<Formsy.Form disabled={this.state.bool}>
{this.state.bool ?
<TestInput name="foo" /> :
<TestInput name="bar" />
<TestInput name="bar" />
}
</Formsy.Form>
);
@ -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(<TestForm/>);
var formEl = TestUtils.findRenderedDOMComponentWithTag(form, 'form');
TestUtils.Simulate.submit(formEl);
});
});

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -33,7 +33,7 @@ describe('Rules: isLength', function() {
});
afterEach(function() {
TestInput = isValid = isInvalid = form = null;
TestInput = isValid = form = null;
});
describe('isLength:3', function() {

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -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());

View File

@ -33,7 +33,7 @@ describe('Rules: minLength', function() {
});
afterEach(function() {
TestInput = isValid = isInvalid = form = null;
TestInput = isValid = form = null;
});
describe('minLength:3', function() {

View File

@ -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();