fix date filter to igrone falsy input

This commit is contained in:
Misko Hevery
2010-10-19 20:38:49 -07:00
parent a0ac6725ed
commit c5cfe2b393
2 changed files with 7 additions and 1 deletions

View File

@@ -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());