From b1e18788615c8eb8248e3026a3e48bd1af8d3f6a Mon Sep 17 00:00:00 2001 From: El RIDO Date: Thu, 16 Nov 2017 08:50:38 +0100 Subject: [PATCH] fully testing remaining time display function --- js/test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/test.js b/js/test.js index 4d9b6eb4..dfbeb38f 100644 --- a/js/test.js +++ b/js/test.js @@ -1226,14 +1226,17 @@ describe('PasteStatus', function () { $.PrivateBin.PasteStatus.showRemainingTime({ 'burnafterreading': burnafterreading, 'remaining_time': remaining_time, - 'expire_date': ((new Date()).getTime() / 1000) + remaining_time + 'expire_date': remaining_time ? ((new Date()).getTime() / 1000) + remaining_time : 0 }); if (burnafterreading) { var result = $('#remainingtime').hasClass('foryoureyesonly') && !$('#remainingtime').hasClass('hidden'); - } else { + } else if (remaining_time) { var result =!$('#remainingtime').hasClass('foryoureyesonly') && !$('#remainingtime').hasClass('hidden'); + } else { + var result = $('#remainingtime').hasClass('hidden') && + !$('#remainingtime').hasClass('foryoureyesonly'); } clean(); return result;