diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-09 15:57:10 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-09 15:57:18 +0200 |
commit | 2824b43b7332e847810f042c4183ce95ee90e852 (patch) | |
tree | 9a10f31c8acbf01d72336d3d065f8c8fda4b83c5 /js/vendor/angular-ui/modules/filters/format/test/formatSpec.js | |
parent | f0abeddd07fcf21e30c95d58885416ef40d65391 (diff) |
use bower for managing deps
Diffstat (limited to 'js/vendor/angular-ui/modules/filters/format/test/formatSpec.js')
-rw-r--r-- | js/vendor/angular-ui/modules/filters/format/test/formatSpec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/vendor/angular-ui/modules/filters/format/test/formatSpec.js b/js/vendor/angular-ui/modules/filters/format/test/formatSpec.js new file mode 100644 index 000000000..5d83fdb63 --- /dev/null +++ b/js/vendor/angular-ui/modules/filters/format/test/formatSpec.js @@ -0,0 +1,21 @@ +describe('format', function() { + var formatFilter; + + beforeEach(module('ui.filters')); + beforeEach(inject(function($filter) { + formatFilter = $filter('format'); + })); + + it('should replace all instances of $0 if string token is passed', function() { + expect(formatFilter('First $0, then $0, finally $0', 'bob')).toEqual('First bob, then bob, finally bob'); + }); + it('should replace all instances of $n based on order of token array', function() { + expect(formatFilter('First is $0, then $1, finally $2', ['bob','frank','dianne'])).toEqual('First is bob, then frank, finally dianne'); + }); + it('should replace all instances :tokens based on keys of token object', function() { + expect(formatFilter('First is :first, next is :second, finally there is :third', {first:'bob',second:'frank',third:'dianne'})).toEqual('First is bob, next is frank, finally there is dianne'); + }); + it('should do nothing if tokens are undefined', function() { + expect(formatFilter('Hello There')).toEqual('Hello There'); + }); +});
\ No newline at end of file |