Skip to content

Commit

Permalink
adding test case for 4696 4706
Browse files Browse the repository at this point in the history
  • Loading branch information
ronak1009 committed Oct 6, 2017
1 parent 0da00a1 commit 939ce63
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/unit/property-accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@

})
});
test('testing for deserialization of date', function(done) {
var dateArr = [];
dateArr[0] = new Date();
dateArr[1] = String(dateArr[0].getTime()); //string timestamp
dateArr[2] = dateArr[0].getTime(); //number timestamp
dateArr[3] = dateArr[0].toString(); //full date
setTimeout(function(){
let ser = [];
ser[0] = window.XFoo.prototype._deserializeValue(dateArr[1], Date);
ser[1] = window.XFoo.prototype._deserializeValue(dateArr[2], Date);
ser[2] = window.XFoo.prototype._deserializeValue(dateArr[3], Date);
assert.equal(ser[0].getTime(), ser[1].getTime());
assert.equal(ser[0].toString(), dateArr[3]);
done();
});
});

});

Expand Down

0 comments on commit 939ce63

Please sign in to comment.