How to use the availity-reactstrap-validation.AvValidator.email 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.email.spec.js View on Github external
import {AvValidator} from 'availity-reactstrap-validation';

const fn = AvValidator.email;

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

  it('should return true for a valid email', () => {
    expect(fn('evan.sharp@availity.com')).to.be.true;
    expect(fn('evan.sharp+more-things@availity.com')).to.be.true;
    expect(fn('evan.sharp@availity.com.co')).to.be.true;
    expect(fn('evan.sharp@development.availity.com')).to.be.true;
    expect(fn('Evan.Sharp@Availity.com')).to.be.true;
  });

  it('should return false for an invalid email', () => {
    expect(fn('evan.sharp@availity')).to.be.false;