aboutsummaryrefslogtreecommitdiffstats
path: root/test/FiltersSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-10-19 20:38:49 -0700
committerMisko Hevery2010-10-19 20:38:49 -0700
commitc5cfe2b3936f3175a97c7ac3f4b5f47632f197f4 (patch)
tree0a6cd9e2ab6922efc1388a452d16e7cbd65386b1 /test/FiltersSpec.js
parenta0ac6725ede819a726d484ebafa72be76a6dd2b8 (diff)
downloadangular.js-c5cfe2b3936f3175a97c7ac3f4b5f47632f197f4.tar.bz2
fix date filter to igrone falsy input
Diffstat (limited to 'test/FiltersSpec.js')
-rw-r--r--test/FiltersSpec.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/FiltersSpec.js b/test/FiltersSpec.js
index 3e5ca9a6..fbaceac6 100644
--- a/test/FiltersSpec.js
+++ b/test/FiltersSpec.js
@@ -100,6 +100,12 @@ describe('filter', function(){
midnight.getTimezoneOffset =
function() { return 7 * 60; };
+ it('should ignore falsy inputs', function() {
+ expect(filter.date(null)).toEqual(null);
+ expect(filter.date('')).toEqual('');
+ expect(filter.date(123)).toEqual(123);
+ });
+
it('should do basic filter', function() {
expect(filter.date(noon)).toEqual(noon.toLocaleDateString());
expect(filter.date(noon, '')).toEqual(noon.toLocaleDateString());