{"size": 1773, "ext": "js", "max_stars_repo_path": "src/filters.usPhoneNumber/test/usPhoneNumber.spec.js", "max_stars_repo_name": "OSTUSA/ng-ost", "max_stars_repo_stars_event_min_datetime": "2015-04-16T18:12:14.000Z", "max_stars_repo_stars_event_max_datetime": "2015-04-16T18:12:14.000Z", "max_issues_repo_path": "src/filters.usPhoneNumber/test/usPhoneNumber.spec.js", "max_issues_repo_name": "OSTUSA/ng-ost", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/filters.usPhoneNumber/test/usPhoneNumber.spec.js", "max_forks_repo_name": "OSTUSA/ng-ost", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.4528301887, "max_line_length": 112, "alphanum_fraction": 0.6198533559}
describe("usPhoneNumber Filter", function () {

    var filter;
    beforeEach(angular.mock.module('ngOst.filters.usPhoneNumber'));

    beforeEach(inject(function ($filter) {
        filter = $filter('usPhoneNumber');
    }));

    it('should be registered in the filterService', function () {
        expect(filter).not.toBe(null);
    });

    it('should return null if a null value is supplied', function () {
        expect(filter(null)).toBeNull();
    });

    it('should return undefined if an undefined value is supplied', function () {
        expect(filter(undefined)).toBeUndefined();
    });

    it('should return "1(555)123-4567" if "15551234567" is supplied', function () {
        expect(filter("15551234567")).toBe('1(555)123-4567');
    });

    it('should return "1(555)123-4567" if "5551234567" is supplied and showCountryCode is true', function () {
        expect(filter("5551234567", true)).toBe('1(555)123-4567');
    });

    it('should return "(555)123-4567" if "5551234567" is supplied', function () {
        expect(filter("5551234567")).toBe('(555)123-4567');
    });

    it('should return "(555)123-4567" if "15551234567" is supplied and showCountryCode is false', function () {
        expect(filter("15551234567", false)).toBe('(555)123-4567');
    });

    it('should return "asdf123" if "asdf123" is supplied', function () {
        expect(filter("asdf123")).toBe('asdf123');
    });

    it('should return "(555)123-4567" if "555-123-4567" is supplied', function () {
        expect(filter("555-123-4567")).toBe('(555)123-4567');
    });

    it('should return "1(555)123-4567" if "555-123-4567" is supplied and showCountryCode is true', function () {
        expect(filter("555-123-4567", true)).toBe('1(555)123-4567');
    });



});
