Skip to content

Commit c93b44a

Browse files
authored
Merge pull request #148 from Fryguy/typo
Fix typo lenght => length
2 parents c49d384 + 65cafa0 commit c93b44a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

packages/react-form-renderer/src/tests/validators/validators.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ describe('New validators', () => {
2828
});
2929

3030
describe('Length validator', () => {
31-
it('should pass exact lenght of 5 characters validation', () => {
31+
it('should pass exact length of 5 characters validation', () => {
3232
expect(validatorMapper(validators.EXACT_LENGTH)({ threshold: 5 })('12345')).toBeUndefined();
3333
});
3434

35-
it('should fail exact lenght of 5 characters validation', () => {
35+
it('should fail exact length of 5 characters validation', () => {
3636
expect(validatorMapper(validators.EXACT_LENGTH)({ threshold: 5 })('1234')).toBe('Should be 5 characters long.');
3737
});
3838

39-
it('should fail exact lenght of 5 characters validation with custom message', () => {
39+
it('should fail exact length of 5 characters validation with custom message', () => {
4040
expect(validatorMapper(validators.EXACT_LENGTH)({ threshold: 5, message: 'Not 5 long' })('123456')).toBe('Not 5 long');
4141
});
4242

@@ -52,15 +52,15 @@ describe('New validators', () => {
5252
expect(validatorMapper(validators.MIN_LENGTH)({ threshold: 3, message: 'Too short!' })('12')).toBe('Too short!');
5353
});
5454

55-
it('should pass max lenght of 3 characters long validation', () => {
55+
it('should pass max length of 3 characters long validation', () => {
5656
expect(validatorMapper(validators.MAX_LENGTH)({ threshold: 3 })('12')).toBeUndefined();
5757
});
5858

59-
it('should not pass max lenght of 3 characters validation', () => {
59+
it('should not pass max length of 3 characters validation', () => {
6060
expect(validatorMapper(validators.MAX_LENGTH)({ threshold: 3 })('1234')).toBe('Can have maximum of 3 characters.');
6161
});
6262

63-
it('should not pass max lenght of 3 characters validation with custom message', () => {
63+
it('should not pass max length of 3 characters validation with custom message', () => {
6464
expect(validatorMapper(validators.MAX_LENGTH)({ threshold: 3, message: 'Too long!' })('1234')).toBe('Too long!');
6565
});
6666

packages/react-renderer-demo/src/docs-components/component-mapper/form-fields-mapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ const FormFieldsMapper = () => {
6161
name: 'first-name',
6262
label: 'First name',
6363
isRequired: true,
64-
validate: [ value => !value || value.lenght === 0 ? 'Required' : undefined ],
64+
validate: [ value => !value || value.length === 0 ? 'Required' : undefined ],
6565
customProp: true,
6666
}, {
6767
component: componentTypes.TEXT_FIELD,
6868
name: 'last-name',
6969
label: 'Last name',
7070
isRequired: true,
71-
validate: [ value => !value || value.lenght === 0 ? 'Required' : undefined ],
71+
validate: [ value => !value || value.length === 0 ? 'Required' : undefined ],
7272
}, {
7373
component: componentTypes.TEXT_FIELD,
7474
name: 'age',

packages/react-renderer-demo/src/docs-components/validators/length-validators.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const schema = {
2828
}],
2929
};
3030

31-
const LenghtValidators = () => (
31+
const LengthValidators = () => (
3232
<div className="pf4">
3333
<FormRenderer
3434
layoutMapper={ layoutMapper }
@@ -39,5 +39,5 @@ const LenghtValidators = () => (
3939
</div>
4040
);
4141

42-
export default LenghtValidators;
42+
export default LengthValidators;
4343

0 commit comments

Comments
 (0)