Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/uploads/../uploads/../../../../instantly.picotech.app/homes/../../wa.picotech.app/public_html/node_modules/path-exists/../duplexify/./../@protobufjs/../cheerio/.././cliui/../curve25519-js/../libphonenumber-js/es6/../source
الملفات الموجودة في هذا الـ Path:
.
..
AsYouType.js
AsYouType.test.js
AsYouTypeFormatter.PatternMatcher.d.ts
AsYouTypeFormatter.PatternMatcher.js
AsYouTypeFormatter.PatternMatcher.test.js
AsYouTypeFormatter.PatternParser.d.ts
AsYouTypeFormatter.PatternParser.js
AsYouTypeFormatter.PatternParser.test.js
AsYouTypeFormatter.complete.js
AsYouTypeFormatter.js
AsYouTypeFormatter.util.js
AsYouTypeFormatter.util.test.js
AsYouTypeParser.js
AsYouTypeState.js
ParseError.js
PhoneNumber.js
PhoneNumber.test.js
PhoneNumberMatcher.js
PhoneNumberMatcher.test.js
constants.js
findNumbers
findPhoneNumbersInText.js
findPhoneNumbersInText.test.js
format.js
format.test.js
formatIncompletePhoneNumber.js
formatIncompletePhoneNumber.test.js
formatPhoneNumberForMobileDialing.js
formatPhoneNumberForMobileDialing.test.js
getCountries.js
getCountries.test.js
getCountryCallingCode.js
getCountryCallingCode.test.js
getExampleNumber.js
getExampleNumber.test.js
helpers
isPossible.js
isPossible.test.js
isPossiblePhoneNumber.js
isPossiblePhoneNumber.test.js
isValid.js
isValid.test.js
isValidPhoneNumber.js
isValidPhoneNumber.test.js
legacy
metadata.js
metadata.test.js
normalizeArguments.js
parse.js
parse.test.js
parseIncompletePhoneNumber.js
parseIncompletePhoneNumber.test.js
parsePhoneNumber.js
parsePhoneNumber.test.js
parsePhoneNumberWithError.js
parsePhoneNumberWithError.test.js
parsePhoneNumberWithError_.js
parsePhoneNumber_.js
searchPhoneNumbersInText.js
searchPhoneNumbersInText.test.js
tools
validatePhoneNumberLength.js
validatePhoneNumberLength.test.js

مشاهدة ملف: validatePhoneNumberLength.test.js

import _validatePhoneNumberLength from './validatePhoneNumberLength.js'
import metadata from '../metadata.min.json' assert { type: 'json' }

function validatePhoneNumberLength(...parameters) {
	parameters.push(metadata)
	return _validatePhoneNumberLength.apply(this, parameters)
}

describe('validatePhoneNumberLength', () => {
	it('should detect whether a phone number length is valid', () => {
		// Not a phone number.
		validatePhoneNumberLength('+').should.equal('NOT_A_NUMBER')
		validatePhoneNumberLength('abcde').should.equal('NOT_A_NUMBER')

		// No country supplied for a national number.
		validatePhoneNumberLength('123').should.equal('INVALID_COUNTRY')

		// Too short while the number is not considered "viable"
		// by Google's `libphonenumber`.
		validatePhoneNumberLength('2', 'US').should.equal('TOO_SHORT')
		validatePhoneNumberLength('+1', 'US').should.equal('TOO_SHORT')
		validatePhoneNumberLength('+12', 'US').should.equal('TOO_SHORT')

		// Test national (significant) number length.
		validatePhoneNumberLength('444 1 44', 'TR').should.equal('TOO_SHORT')
		expect(validatePhoneNumberLength('444 1 444', 'TR')).to.be.undefined
		validatePhoneNumberLength('444 1 4444', 'TR').should.equal('INVALID_LENGTH')
		validatePhoneNumberLength('444 1 4444444444', 'TR').should.equal('TOO_LONG')
	})
})