Sha256: 0c407997a79310addcc0a2df417a885e548dc9e55390cec4bb82973efb5a9343

Contents?: true

Size: 1.13 KB

Versions: 112

Compression:

Stored size: 1.13 KB

Contents

var PhoneNumber = require('./phone-number');

describe('PhoneNumber()', function() {
  it('cleans the number (123) 456-7890', function() {
    var phone = new PhoneNumber('(123) 456-7890');
    expect(phone.number()).toEqual('1234567890');
  });

  xit('cleans numbers with dots', function() {
    var phone = new PhoneNumber('123.456.7890');
    expect(phone.number()).toEqual('1234567890');
  });

  xit('valid when 11 digits and first digit is 1', function() {
    var phone = new PhoneNumber('11234567890');
    expect(phone.number()).toEqual('1234567890');
  });

  xit('invalid when 11 digits', function() {
    var phone = new PhoneNumber('21234567890');
    expect(phone.number()).toEqual('0000000000');
  });

  xit('invalid when 9 digits', function() {
    var phone = new PhoneNumber('123456789');
    expect(phone.number()).toEqual('0000000000');
  });

  xit('has an area code', function() {
    var phone = new PhoneNumber('1234567890');
    expect(phone.areaCode()).toEqual('123');
  });

  xit('formats a number', function() {
    var phone = new PhoneNumber('1234567890');
    expect(phone.toString()).toEqual('(123) 456-7890');
  });
});

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
trackler-2.0.8.11 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.10 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.9 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.8 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.7 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.6 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.5 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.4 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.3 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.2 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.8.1 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.7.0 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.44 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.43 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.42 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.41 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.40 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.39 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.38 tracks/javascript/exercises/phone-number/phone-number.spec.js
trackler-2.0.6.37 tracks/javascript/exercises/phone-number/phone-number.spec.js