Sha256: 2ca850a66c51733cfcda04dbc20230c963bf70e11e980c5949ddabc9ca05d2cf

Contents?: true

Size: 891 Bytes

Versions: 4

Compression:

Stored size: 891 Bytes

Contents

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

var TwitterCldr = require('../../../lib/assets/javascripts/twitter_cldr/core.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-3.3.0 spec/js/shared/phone_codes.spec.js
twitter_cldr_js-3.2.0 spec/js/shared/phone_codes.spec.js
twitter_cldr_js-3.1.1 spec/js/shared/phone_codes.spec.js
twitter_cldr_js-3.1.0 spec/js/shared/phone_codes.spec.js