From 751731414e15fc079dfab12a61ce230878ec1b51 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 30 Oct 2017 06:53:15 +0100 Subject: [PATCH] adding test for loading indicator --- js/test.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/js/test.js b/js/test.js index 63b6ba42..bd0fb02a 100644 --- a/js/test.js +++ b/js/test.js @@ -1031,5 +1031,40 @@ describe('Alert', function () { } ); }); + + describe('showLoading', function () { + before(function () { + cleanup(); + }); + + jsc.property( + 'shows a loding message', + jsc.array(jsc.elements(alnumString)), + jsc.array(jsc.elements(alnumString)), + 'integer', + function (icon, message, number) { + icon = icon.join(''); + message = message.join(''); + var default_message = 'Loading…'; + if (message.length == 0) { + message = default_message; + } + var expected = ''; + $('body').html( + '' + ); + $.PrivateBin.Alert.init(); + $.PrivateBin.Alert.showLoading(message, number, icon); + var result = $('body').html(); + return expected === result; + } + ); + }); });