From 1fd13981d4d18e6a9eef3bee7e9187c25766d6a8 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 4 Nov 2017 07:40:26 +0100 Subject: [PATCH] adding test for hiding loading indicator --- js/test.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/js/test.js b/js/test.js index 03b817b..2462cc2 100644 --- a/js/test.js +++ b/js/test.js @@ -1038,7 +1038,7 @@ describe('Alert', function () { }); jsc.property( - 'shows a loding message', + 'shows a loading message', jsc.array(jsc.elements(alnumString)), jsc.array(jsc.elements(alnumString)), 'integer', @@ -1066,5 +1066,28 @@ describe('Alert', function () { } ); }); + + describe('hideLoading', function () { + before(function () { + cleanup(); + }); + + it( + 'hides the loading message', + function() { + $('body').html( + '' + ); + $('body').addClass('loading'); + $.PrivateBin.Alert.init(); + $.PrivateBin.Alert.hideLoading(); + return !$('body').hasClass('loading') && + $('#loadingindicator').hasClass('hidden'); + } + ); + }); });