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 #4694 from scampi/undefined-date
missing date patch
- Loading branch information
Showing
3 changed files
with
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
describe('Date Format', function () { | ||
var fieldFormats; | ||
var expect = require('expect.js'); | ||
var ngMock = require('ngMock'); | ||
|
||
beforeEach(ngMock.module('kibana')); | ||
beforeEach(ngMock.inject(function (Private) { | ||
fieldFormats = Private(require('ui/registry/field_formats')); | ||
})); | ||
|
||
it('decoding an undefined or null date should return an empty string', function () { | ||
var DateFormat = fieldFormats.getType('date'); | ||
var date = new DateFormat({ | ||
pattern: 'dd-MM-yyyy' | ||
}); | ||
expect(date.convert(null)).to.be(''); | ||
expect(date.convert(undefined)).to.be(''); | ||
}); | ||
|
||
}); |
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