mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-19 16:12:14 +11:00
27 lines
No EOL
1.1 KiB
JavaScript
27 lines
No EOL
1.1 KiB
JavaScript
import _isPossiblePhoneNumber from './isPossiblePhoneNumber';
|
|
import metadata from '../metadata.min.json';
|
|
|
|
function isPossiblePhoneNumber() {
|
|
for (var _len = arguments.length, parameters = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
parameters[_key] = arguments[_key];
|
|
}
|
|
|
|
parameters.push(metadata);
|
|
return _isPossiblePhoneNumber.apply(this, parameters);
|
|
}
|
|
|
|
describe('isPossiblePhoneNumber', function () {
|
|
it('should detect whether a phone number is possible', function () {
|
|
isPossiblePhoneNumber('8 (800) 555 35 35', 'RU').should.equal(true);
|
|
isPossiblePhoneNumber('8 (800) 555 35 35 0', 'RU').should.equal(false);
|
|
isPossiblePhoneNumber('Call: 8 (800) 555 35 35', 'RU').should.equal(false);
|
|
isPossiblePhoneNumber('8 (800) 555 35 35', {
|
|
defaultCountry: 'RU'
|
|
}).should.equal(true);
|
|
isPossiblePhoneNumber('+7 (800) 555 35 35').should.equal(true);
|
|
isPossiblePhoneNumber('+7 1 (800) 555 35 35').should.equal(false);
|
|
isPossiblePhoneNumber(' +7 (800) 555 35 35').should.equal(false);
|
|
isPossiblePhoneNumber(' ').should.equal(false);
|
|
});
|
|
});
|
|
//# sourceMappingURL=isPossiblePhoneNumber.test.js.map
|