-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from fkammer/add-iban-filter
Add angular filter to display IBANs in a human-friendly format
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
describe 'Filter: iban', -> | ||
|
||
# load the filter's module | ||
beforeEach module 'mm.iban' | ||
|
||
filter = undefined | ||
|
||
beforeEach inject ($filter) -> | ||
filter = $filter 'iban' | ||
|
||
it 'electronic IBAN should become print IBAN', -> | ||
expect(filter('NL91ABNA0417164300')).toEqual 'NL91 ABNA 0417 1643 00' | ||
|
||
it 'invalid IBAN should stay untouched', -> | ||
expect(filter('INVALIDIBAN')).toEqual 'INVALIDIBAN' | ||
expect(filter('NL90ABNA0417164300')).toEqual 'NL90ABNA0417164300' | ||
|
||
it 'mind custom separator', -> | ||
expect(filter('NL91ABNA0417164300', '-')).toEqual 'NL91-ABNA-0417-1643-00' | ||
expect(filter('NL91ABNA0417164300', '')).toEqual 'NL91ABNA0417164300' |