formatIncompletePhoneNumber.test.js 1.5 KB

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. var _formatIncompletePhoneNumber = _interopRequireDefault(require("./formatIncompletePhoneNumber.js"));
  3. var _metadataMin = _interopRequireDefault(require("../metadata.min.json"));
  4. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5. describe('formatIncompletePhoneNumber', function () {
  6. it('should format parsed input value', function () {
  7. var result; // National input.
  8. (0, _formatIncompletePhoneNumber["default"])('880055535', 'RU', _metadataMin["default"]).should.equal('8 (800) 555-35'); // International input, no country.
  9. (0, _formatIncompletePhoneNumber["default"])('+780055535', null, _metadataMin["default"]).should.equal('+7 800 555 35'); // International input, no country argument.
  10. (0, _formatIncompletePhoneNumber["default"])('+780055535', _metadataMin["default"]).should.equal('+7 800 555 35'); // International input, with country.
  11. (0, _formatIncompletePhoneNumber["default"])('+780055535', 'RU', _metadataMin["default"]).should.equal('+7 800 555 35');
  12. });
  13. it('should support an object argument', function () {
  14. (0, _formatIncompletePhoneNumber["default"])('880055535', {
  15. defaultCountry: 'RU'
  16. }, _metadataMin["default"]).should.equal('8 (800) 555-35');
  17. (0, _formatIncompletePhoneNumber["default"])('880055535', {
  18. defaultCallingCode: '7'
  19. }, _metadataMin["default"]).should.equal('8 (800) 555-35');
  20. });
  21. });
  22. //# sourceMappingURL=formatIncompletePhoneNumber.test.js.map