Sha256: 8af0b2f083050fd7d21dc90e1e4edce8ebe117c93a45756713075eeab4814582

Contents?: true

Size: 889 Bytes

Versions: 4

Compression:

Stored size: 889 Bytes

Contents

// Copyright 2012 Twitter, Inc
// http://www.apache.org/licenses/LICENSE-2.0

var TwitterCldr = require('../../../lib/assets/javascripts/twitter_cldr/en.js');

describe("PhoneCodes", function() {
  describe("#all", function() {
    it("checks if some territories are supported", function() {
      expect(TwitterCldr.PhoneCodes.territories()).toContain("jp");
    });
    it("checks if invalid territory codes are not supported", function() {
      expect(TwitterCldr.PhoneCodes.territories()).not.toContain("xx");
    });
  });

  describe("#code_for_territory", function() {
    it("returns '20' for the territory 'eg'", function() {
      expect(TwitterCldr.PhoneCodes.code_for_territory("eg")).toEqual("20");
    });
    it("returns null for invalid territories like 'xx' (say)", function() {
      expect(TwitterCldr.PhoneCodes.code_for_territory("xx")).toBe(null);
    });
  });
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twitter_cldr_js-2.4.0 spec/js/shared/phone_codes.spec.js
twitter_cldr_js-2.3.2 spec/js/shared/phone_codes.spec.js
twitter_cldr_js-2.3.1 spec/js/shared/phone_codes.spec.js
twitter_cldr_js-2.3.0 spec/js/shared/phone_codes.spec.js