From fcfb02c2b773da90745f4ec3eb9a79f80262d795 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Fri, 26 May 2017 20:55:45 +0200 Subject: [PATCH] added tests for getFormatterDefault(), fixing bug in compact design --- js/test.js | 34 ++++++++++++++++++++++++++++++++++ tpl/bootstrap.php | 11 +++++++++++ 2 files changed, 45 insertions(+) diff --git a/js/test.js b/js/test.js index 3f24a2e..c1eec7e 100644 --- a/js/test.js +++ b/js/test.js @@ -595,6 +595,40 @@ describe('Model', function () { ); }); + describe('getFormatDefault', function () { + before(function () { + $.PrivateBin.Model.reset(); + cleanup(); + }); + + jsc.property( + 'returns the contents of the element with id "pasteFormatter"', + '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.getFormatDefault() + ); + $.PrivateBin.Model.reset(); + return content === result; + } + ); + }); + describe('getPasteId', function () { before(function () { $.PrivateBin.Model.reset(); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 6fc01bd..8933ea6 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -230,6 +230,17 @@ if ($isCpct): ?>