diff --git a/js/test.js b/js/test.js index 63b6ba4..bd0fb02 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; + } + ); + }); });