From 939ce63ced8d3ff34ab6b196d95f4a31bf856697 Mon Sep 17 00:00:00 2001 From: Ronak SHAH Date: Fri, 6 Oct 2017 19:14:45 +0530 Subject: [PATCH] adding test case for 4696 4706 --- test/unit/property-accessors.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/unit/property-accessors.html b/test/unit/property-accessors.html index 8af5eeb265..147cd643b3 100644 --- a/test/unit/property-accessors.html +++ b/test/unit/property-accessors.html @@ -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(); + }); + }); });