Skip to content

Commit a904b9f

Browse files
committed
feat(release): v0.3.2
1 parent 8d2c522 commit a904b9f

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-form-validator",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "React native library to validate form fields",
55
"main": "index.js",
66
"scripts": {
@@ -25,13 +25,12 @@
2525
"homepage": "https://github.com/perscrew/react-native-form-validator#readme",
2626
"dependencies": {
2727
"moment": "^2.11.2",
28-
"prop-types" : "15.6.0"
28+
"prop-types": "15.6.0"
2929
},
3030
"devDependencies": {
3131
"react": "~15.4.0",
3232
"react-native": "^0.42.0",
3333
"cz-conventional-changelog": "^1.1.6",
34-
3534
"babel-core": "^6.5.2",
3635
"babel-preset-react-native": "^1.8.0",
3736
"chai": "^3.5.0",

test/index.test.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
'use strict';
22

3-
import React, {Component} from 'react';
4-
import { Text, View, TextInput } from 'react-native';
5-
import {shallow, mount} from 'enzyme';
6-
import Moment from 'moment';
7-
import {expect} from 'chai';
8-
import sinon from 'sinon';
3+
import { expect } from 'chai';
4+
import { mount, shallow } from 'enzyme';
5+
/*---------------- mock DOM ----------------*/
6+
import { jsdom } from 'jsdom';
7+
import React from 'react';
8+
import { TextInput } from 'react-native';
99
import FormTest from './formTest';
1010

11-
/*---------------- mock DOM ----------------*/
12-
import {jsdom} from 'jsdom';
1311
var exposedProperties = ['window', 'navigator', 'document'];
1412

1513
global.document = jsdom('');
@@ -84,17 +82,17 @@ describe('ValidationComponent:', () => {
8482
formTest._onPressButton();
8583

8684
expect(formTest.isFormValid()).to.equal(false);
87-
expect(formTest.getErrorMessages()).to.equal('The field "name" length must be greater than 3.');
85+
expect(formTest.getErrorMessages()).to.equal('The field "name" length must be greater than 2.');
8886
expect(formTest.isFieldInError('name')).to.equal(true);
8987

9088
// Seize an empty value
9189
textInput.simulate('changeText', ""); // minlength = 3
9290
formTest._onPressButton();
9391
expect(formTest.isFormValid()).to.equal(false);
9492
expect(formTest.getErrorMessages()).to.
95-
equal('The field "name" length must be greater than 3.\nThe field "name" is mandatory.');
93+
equal('The field "name" length must be greater than 2.\nThe field "name" is mandatory.');
9694
expect(formTest.getErrorsInField('name')).to.deep.equal([
97-
'The field "name" length must be greater than 3.',
95+
'The field "name" length must be greater than 2.',
9896
'The field "name" is mandatory.'
9997
])
10098
expect(formTest.isFieldInError('name')).to.equal(true);

0 commit comments

Comments
 (0)