From 9f01ccc80e313a7eb59966a0cd5fc05cccd3c8a3 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 22 May 2017 22:15:13 +0200 Subject: [PATCH] added tests for getExpirationDefault() --- js/test.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/js/test.js b/js/test.js index c6e5c7a6..3f24a2eb 100644 --- a/js/test.js +++ b/js/test.js @@ -561,6 +561,40 @@ describe('CryptTool', function () { }); describe('Model', function () { + describe('getExpirationDefault', function () { + before(function () { + $.PrivateBin.Model.reset(); + cleanup(); + }); + + jsc.property( + 'returns the contents of the element with id "pasteExpiration"', + 'array asciinestring', + 'string', + 'small nat', + function (keys, value, key) { + keys = keys.map($.PrivateBin.Helper.htmlEntities); + value = $.PrivateBin.Helper.htmlEntities(value); + var content = keys.length > key ? keys[key] : (keys.length > 0 ? keys[0] : 'null'), + contents = ''; + $('body').html(contents); + var result = $.PrivateBin.Helper.htmlEntities( + $.PrivateBin.Model.getExpirationDefault() + ); + $.PrivateBin.Model.reset(); + return content === result; + } + ); + }); + describe('getPasteId', function () { before(function () { $.PrivateBin.Model.reset();