How to use the availity-reactstrap-validation.AvValidator.minlength function in availity-reactstrap-validation

To help you get started, we’ve selected a few availity-reactstrap-validation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Availity / availity-reactstrap-validation / __test__ / AvValidator.minlength.spec.js View on Github external
import {AvValidator} from 'availity-reactstrap-validation';

const fn = AvValidator.minlength;

describe('Min Length Validation', () => {
  it('should not require a value', () => {
    expect(fn('')).to.be.true;
  });

  it('have an alias of minLength', () => {
    expect(fn).to.equal(AvValidator.minLength);
  });

  it('should return true if the value length is greater than the constraint', () => {
    expect(fn('123456', undefined, {value: 5})).to.be.true;
  });

  it('should true if the value is the same as than the constraint', () => {
    expect(fn('12345', undefined, {value: 5})).to.be.true;