This test isn't going to work, because the HTML5 spec does not specify that the raw-converted date object is returned. Rather in the definition of valueAsDate, if the conversion algorithm (string->date) fails to return a Date (which it will for the empty string), then null is returned.