Repository URL to install this package:
Version:
0.9.5 ▾
|
/* eslint-disable max-statements */
import { isValidLength } from '../'
describe('validators.length', () => {
it('allows values with valid length', () => {
expect(isValidLength('Joe')).toBeTruthy()
expect(isValidLength('123')).toBeTruthy()
})
it('does not allow undefined values', () => {
expect(isValidLength(null)).toBeFalsy()
expect(isValidLength(undefined)).toBeFalsy()
})
it('does not not allow empty values', () => {
expect(isValidLength('')).toBeFalsy()
// White space is allowed?
// expect(isValidLength(' ')).toBeFalsy()
})
})