-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dca19b2
commit 7abc08d
Showing
20 changed files
with
1,414 additions
and
1,449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,46 @@ | ||
'use strict'; | ||
|
||
describe('ui.utils.masks.br.car-plate', function() { | ||
describe('uiBrCarPlateMask', function() { | ||
it('should load the demo page', function() { | ||
browser.get('/src/br/car-plate/car-plate.html'); | ||
expect(browser.getTitle()).toEqual('Car Plate Spec'); | ||
}); | ||
|
||
describe('ui-br-car-plate-mask:', function() { | ||
it('should apply a Car Plate mask while the user is typping:', function() { | ||
var BS = protractor.Key.BACK_SPACE; | ||
it('should apply a Car Plate mask while the user is typping:', function() { | ||
var BS = protractor.Key.BACK_SPACE; | ||
|
||
var tests = [ | ||
{key:'@', viewValue:'', modelValue:''}, | ||
{key:'A', viewValue:'A', modelValue:'A'}, | ||
{key:'B', viewValue:'AB', modelValue:'AB'}, | ||
{key:'C', viewValue:'ABC', modelValue:'ABC'}, | ||
{key:'-', viewValue:'ABC', modelValue:'ABC'}, | ||
{key:'2', viewValue:'ABC-2', modelValue:'ABC2'}, | ||
{key:'0', viewValue:'ABC-20', modelValue:'ABC20'}, | ||
{key:'1', viewValue:'ABC-201', modelValue:'ABC201'}, | ||
{key:'0', viewValue:'ABC-2010', modelValue:'ABC2010'}, | ||
{key:'9', viewValue:'ABC-2010', modelValue:'ABC2010'}, | ||
{key:BS, viewValue:'ABC-201', modelValue:'ABC201'}, | ||
{key:BS, viewValue:'ABC-20', modelValue:'ABC20'}, | ||
{key:BS, viewValue:'ABC-2', modelValue:'ABC2'}, | ||
{key:BS, viewValue:'ABC', modelValue:'ABC'}, | ||
{key:BS, viewValue:'AB', modelValue:'AB'}, | ||
{key:BS, viewValue:'A', modelValue:'A'}, | ||
]; | ||
var tests = [ | ||
{key:'@', viewValue:'', modelValue:''}, | ||
{key:'A', viewValue:'A', modelValue:'A'}, | ||
{key:'B', viewValue:'AB', modelValue:'AB'}, | ||
{key:'C', viewValue:'ABC', modelValue:'ABC'}, | ||
{key:'-', viewValue:'ABC', modelValue:'ABC'}, | ||
{key:'2', viewValue:'ABC-2', modelValue:'ABC2'}, | ||
{key:'0', viewValue:'ABC-20', modelValue:'ABC20'}, | ||
{key:'1', viewValue:'ABC-201', modelValue:'ABC201'}, | ||
{key:'0', viewValue:'ABC-2010', modelValue:'ABC2010'}, | ||
{key:'9', viewValue:'ABC-2010', modelValue:'ABC2010'}, | ||
{key:BS, viewValue:'ABC-201', modelValue:'ABC201'}, | ||
{key:BS, viewValue:'ABC-20', modelValue:'ABC20'}, | ||
{key:BS, viewValue:'ABC-2', modelValue:'ABC2'}, | ||
{key:BS, viewValue:'ABC', modelValue:'ABC'}, | ||
{key:BS, viewValue:'AB', modelValue:'AB'}, | ||
{key:BS, viewValue:'A', modelValue:'A'}, | ||
]; | ||
|
||
var input = element(by.model('carPlate')), | ||
value = element(by.binding('carPlate')); | ||
var input = element(by.model('carPlate')), | ||
value = element(by.binding('carPlate')); | ||
|
||
for (var i = 0; i < tests.length; i++) { | ||
input.sendKeys(tests[i].key); | ||
expect(input.getAttribute('value')).toEqual(tests[i].viewValue); | ||
expect(value.getText()).toEqual(tests[i].modelValue); | ||
} | ||
}); | ||
for (var i = 0; i < tests.length; i++) { | ||
input.sendKeys(tests[i].key); | ||
expect(input.getAttribute('value')).toEqual(tests[i].viewValue); | ||
expect(value.getText()).toEqual(tests[i].modelValue); | ||
} | ||
}); | ||
|
||
it('should apply a Car Plate mask in a model with default value:', function() { | ||
var input = element(by.model('initializedCarPlate')); | ||
it('should apply a Car Plate mask in a model with default value:', function() { | ||
var input = element(by.model('initializedCarPlate')); | ||
|
||
expect(input.getAttribute('value')).toEqual('ABC-2010'); | ||
}); | ||
expect(input.getAttribute('value')).toEqual('ABC-2010'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,48 @@ | ||
'use strict'; | ||
|
||
describe('ui.utils.masks.br.cep', function() { | ||
describe('uiBrCepMask', function() { | ||
it('should load the demo page', function() { | ||
browser.get('/src/br/cep/cep.html'); | ||
expect(browser.getTitle()).toEqual('CEP Spec'); | ||
}); | ||
|
||
describe('ui-br-cep-mask:', function() { | ||
it('should apply a CEP mask while the user is typping:', function() { | ||
var BS = protractor.Key.BACK_SPACE; | ||
it('should apply a CEP mask while the user is typping:', function() { | ||
var BS = protractor.Key.BACK_SPACE; | ||
|
||
var tests = [ | ||
{key:'@', viewValue:'', modelValue:''}, | ||
{key:'3', viewValue:'3', modelValue:'3'}, | ||
{key:'0', viewValue:'30', modelValue:'30'}, | ||
{key:'1', viewValue:'301', modelValue:'301'}, | ||
{key:'1', viewValue:'3011', modelValue:'3011'}, | ||
{key:'2', viewValue:'30112', modelValue:'30112'}, | ||
{key:'-', viewValue:'30112', modelValue:'30112'}, | ||
{key:'0', viewValue:'30112-0', modelValue:'301120'}, | ||
{key:'1', viewValue:'30112-01', modelValue:'3011201'}, | ||
{key:'0', viewValue:'30112-010', modelValue:'30112010'}, | ||
{key:'9', viewValue:'30112-010', modelValue:'30112010'}, | ||
{key:BS, viewValue:'30112-01', modelValue:'3011201'}, | ||
{key:BS, viewValue:'30112-0', modelValue:'301120'}, | ||
{key:BS, viewValue:'30112', modelValue:'30112'}, | ||
{key:BS, viewValue:'3011', modelValue:'3011'}, | ||
{key:BS, viewValue:'301', modelValue:'301'}, | ||
{key:BS, viewValue:'30', modelValue:'30'}, | ||
{key:BS, viewValue:'3', modelValue:'3'} | ||
]; | ||
var tests = [ | ||
{key:'@', viewValue:'', modelValue:''}, | ||
{key:'3', viewValue:'3', modelValue:'3'}, | ||
{key:'0', viewValue:'30', modelValue:'30'}, | ||
{key:'1', viewValue:'301', modelValue:'301'}, | ||
{key:'1', viewValue:'3011', modelValue:'3011'}, | ||
{key:'2', viewValue:'30112', modelValue:'30112'}, | ||
{key:'-', viewValue:'30112', modelValue:'30112'}, | ||
{key:'0', viewValue:'30112-0', modelValue:'301120'}, | ||
{key:'1', viewValue:'30112-01', modelValue:'3011201'}, | ||
{key:'0', viewValue:'30112-010', modelValue:'30112010'}, | ||
{key:'9', viewValue:'30112-010', modelValue:'30112010'}, | ||
{key:BS, viewValue:'30112-01', modelValue:'3011201'}, | ||
{key:BS, viewValue:'30112-0', modelValue:'301120'}, | ||
{key:BS, viewValue:'30112', modelValue:'30112'}, | ||
{key:BS, viewValue:'3011', modelValue:'3011'}, | ||
{key:BS, viewValue:'301', modelValue:'301'}, | ||
{key:BS, viewValue:'30', modelValue:'30'}, | ||
{key:BS, viewValue:'3', modelValue:'3'} | ||
]; | ||
|
||
var input = element(by.model('cep')), | ||
value = element(by.binding('cep')); | ||
var input = element(by.model('cep')), | ||
value = element(by.binding('cep')); | ||
|
||
for (var i = 0; i < tests.length; i++) { | ||
input.sendKeys(tests[i].key); | ||
expect(input.getAttribute('value')).toEqual(tests[i].viewValue); | ||
expect(value.getText()).toEqual(tests[i].modelValue); | ||
} | ||
}); | ||
for (var i = 0; i < tests.length; i++) { | ||
input.sendKeys(tests[i].key); | ||
expect(input.getAttribute('value')).toEqual(tests[i].viewValue); | ||
expect(value.getText()).toEqual(tests[i].modelValue); | ||
} | ||
}); | ||
|
||
it('should apply a CEP mask in a model with default value:', function() { | ||
var input = element(by.model('initializedCep')); | ||
it('should apply a CEP mask in a model with default value:', function() { | ||
var input = element(by.model('initializedCep')); | ||
|
||
expect(input.getAttribute('value')).toEqual('30112-010'); | ||
}); | ||
expect(input.getAttribute('value')).toEqual('30112-010'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,66 @@ | ||
'use strict'; | ||
|
||
describe('ui.utils.masks.cpfCnpj', function() { | ||
describe('uiBrCpfcnpjMask', function() { | ||
it('should load the demo page', function() { | ||
browser.get('/src/br/cpf-cnpj/cpf-cnpj.html'); | ||
expect(browser.getTitle()).toEqual('CPF-CNPJ Spec'); | ||
}); | ||
|
||
describe('ui-br-cpfcnpj:', function() { | ||
it('should apply a CPF/CNPJ mask while the user is typping:', function() { | ||
var BS = protractor.Key.BACK_SPACE; | ||
it('should apply a CPF/CNPJ mask while the user is typping:', function() { | ||
var BS = protractor.Key.BACK_SPACE; | ||
|
||
var tests = [ | ||
{key:'1', viewValue:'1', modelValue: '1'}, | ||
{key:'3', viewValue:'13', modelValue: '13'}, | ||
{key:'8', viewValue:'138', modelValue: '138'}, | ||
{key:'8', viewValue:'138.8', modelValue: '1388'}, | ||
{key:'3', viewValue:'138.83', modelValue: '13883'}, | ||
{key:'8', viewValue:'138.838', modelValue: '138838'}, | ||
{key:'7', viewValue:'138.838.7', modelValue: '1388387'}, | ||
{key:'5', viewValue:'138.838.75', modelValue: '13883875'}, | ||
{key:'0', viewValue:'138.838.750', modelValue: '138838750'}, | ||
{key:'0', viewValue:'138.838.750-0', modelValue: '1388387500'}, | ||
{key:'0', viewValue:'138.838.750-00', modelValue: '13883875000'}, | ||
var tests = [ | ||
{key:'1', viewValue:'1', modelValue: '1'}, | ||
{key:'3', viewValue:'13', modelValue: '13'}, | ||
{key:'8', viewValue:'138', modelValue: '138'}, | ||
{key:'8', viewValue:'138.8', modelValue: '1388'}, | ||
{key:'3', viewValue:'138.83', modelValue: '13883'}, | ||
{key:'8', viewValue:'138.838', modelValue: '138838'}, | ||
{key:'7', viewValue:'138.838.7', modelValue: '1388387'}, | ||
{key:'5', viewValue:'138.838.75', modelValue: '13883875'}, | ||
{key:'0', viewValue:'138.838.750', modelValue: '138838750'}, | ||
{key:'0', viewValue:'138.838.750-0', modelValue: '1388387500'}, | ||
{key:'0', viewValue:'138.838.750-00', modelValue: '13883875000'}, | ||
|
||
{key:'1', viewValue:'13.883.875/0001', modelValue: '138838750001'}, | ||
{key:'2', viewValue:'13.883.875/0001-2', modelValue: '1388387500012'}, | ||
{key:'0', viewValue:'13.883.875/0001-20', modelValue: '13883875000120'}, | ||
{key:'0', viewValue:'13.883.875/0001-20', modelValue: '13883875000120'}, | ||
{key:BS, viewValue:'13.883.875/0001-2', modelValue: '1388387500012'}, | ||
{key:BS, viewValue:'13.883.875/0001', modelValue: '138838750001'}, | ||
{key:'1', viewValue:'13.883.875/0001', modelValue: '138838750001'}, | ||
{key:'2', viewValue:'13.883.875/0001-2', modelValue: '1388387500012'}, | ||
{key:'0', viewValue:'13.883.875/0001-20', modelValue: '13883875000120'}, | ||
{key:'0', viewValue:'13.883.875/0001-20', modelValue: '13883875000120'}, | ||
{key:BS, viewValue:'13.883.875/0001-2', modelValue: '1388387500012'}, | ||
{key:BS, viewValue:'13.883.875/0001', modelValue: '138838750001'}, | ||
|
||
{key:BS, viewValue:'138.838.750-00', modelValue: '13883875000'}, | ||
{key:BS, viewValue:'138.838.750-0', modelValue: '1388387500'}, | ||
{key:BS, viewValue:'138.838.750', modelValue: '138838750'}, | ||
{key:BS, viewValue:'138.838.75', modelValue: '13883875'}, | ||
{key:BS, viewValue:'138.838.7', modelValue: '1388387'}, | ||
{key:BS, viewValue:'138.838', modelValue: '138838'}, | ||
{key:BS, viewValue:'138.83', modelValue: '13883'}, | ||
{key:BS, viewValue:'138.8', modelValue: '1388'}, | ||
{key:BS, viewValue:'138', modelValue: '138'}, | ||
{key:BS, viewValue:'13', modelValue: '13'}, | ||
{key:BS, viewValue:'1', modelValue: '1'} | ||
]; | ||
{key:BS, viewValue:'138.838.750-00', modelValue: '13883875000'}, | ||
{key:BS, viewValue:'138.838.750-0', modelValue: '1388387500'}, | ||
{key:BS, viewValue:'138.838.750', modelValue: '138838750'}, | ||
{key:BS, viewValue:'138.838.75', modelValue: '13883875'}, | ||
{key:BS, viewValue:'138.838.7', modelValue: '1388387'}, | ||
{key:BS, viewValue:'138.838', modelValue: '138838'}, | ||
{key:BS, viewValue:'138.83', modelValue: '13883'}, | ||
{key:BS, viewValue:'138.8', modelValue: '1388'}, | ||
{key:BS, viewValue:'138', modelValue: '138'}, | ||
{key:BS, viewValue:'13', modelValue: '13'}, | ||
{key:BS, viewValue:'1', modelValue: '1'} | ||
]; | ||
|
||
var input = element(by.model('cpfcnpj')), | ||
value = element(by.binding('cpfcnpj')); | ||
var input = element(by.model('cpfcnpj')), | ||
value = element(by.binding('cpfcnpj')); | ||
|
||
for (var i = 0; i < tests.length; i++) { | ||
input.sendKeys(tests[i].key); | ||
expect(input.getAttribute('value')).toEqual(tests[i].viewValue); | ||
expect(value.getText()).toEqual(tests[i].modelValue); | ||
} | ||
}); | ||
for (var i = 0; i < tests.length; i++) { | ||
input.sendKeys(tests[i].key); | ||
expect(input.getAttribute('value')).toEqual(tests[i].viewValue); | ||
expect(value.getText()).toEqual(tests[i].modelValue); | ||
} | ||
}); | ||
|
||
it('should apply a CPFCNPJ mask in a model with default CPF value:', function() { | ||
var input = element(by.model('initializedCpfCnpj1')); | ||
it('should apply a CPFCNPJ mask in a model with default CPF value:', function() { | ||
var input = element(by.model('initializedCpfCnpj1')); | ||
|
||
expect(input.getAttribute('value')).toEqual('563.383.329-58'); | ||
}); | ||
expect(input.getAttribute('value')).toEqual('563.383.329-58'); | ||
}); | ||
|
||
it('should apply a CPFCNPJ mask in a model with default CNPJ value:', function() { | ||
var input = element(by.model('initializedCpfCnpj2')); | ||
it('should apply a CPFCNPJ mask in a model with default CNPJ value:', function() { | ||
var input = element(by.model('initializedCpfCnpj2')); | ||
|
||
expect(input.getAttribute('value')).toEqual('23.212.161/0001-44'); | ||
}); | ||
expect(input.getAttribute('value')).toEqual('23.212.161/0001-44'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.