"use strict";

var _index = require("./index");

var _testUtils = require("../utils/test-utils");

describe('Phone Number Tests', function () {
  var model = {
    phone: _index.PhoneNumber
  };
  test('Minumum length is 2', function () {
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '+12'
    })).toBeFalsy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '12'
    })).toBeFalsy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '+1'
    })).toBeTruthy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '1'
    })).toBeTruthy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: ''
    })).toBeTruthy();
  });
  test('Maximum length is 15', function () {
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '+1234567890'
    })).toBeFalsy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '1234567890'
    })).toBeFalsy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '+123456789012345'
    })).toBeFalsy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '123456789012345'
    })).toBeFalsy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '+1234567890123456'
    })).toBeTruthy();
    expect((0, _testUtils.propTypeErrors)(model, {
      phone: '1234567890123456'
    })).toBeTruthy();
  });
});