Просмотр исходного кода

adding test for hiding messages

El RIDO 8 лет назад
Родитель
Сommit
c6e0f2d223
1 измененных файлов с 24 добавлено и 0 удалено
  1. 24 0
      js/test.js

+ 24 - 0
js/test.js

@@ -1089,5 +1089,29 @@ describe('Alert', function () {
             }
         );
     });
+
+    describe('hideMessages', function () {
+        before(function () {
+            cleanup();
+        });
+
+        it(
+            'hides all messages',
+            function() {
+                $('body').html(
+                    '<div id="status" role="alert" class="statusmessage ' +
+                    'alert alert-info"><span class="glyphicon ' +
+                    'glyphicon-info-sign" aria-hidden="true"></span> </div>' +
+                    '<div id="errormessage" role="alert" class="statusmessage ' +
+                    'alert alert-danger"><span class="glyphicon ' +
+                    'glyphicon-alert" aria-hidden="true"></span> </div>'
+                );
+                $.PrivateBin.Alert.init();
+                $.PrivateBin.Alert.hideMessages();
+                return $('#statusmessage').hasClass('hidden') &&
+                    $('#errormessage').hasClass('hidden');
+            }
+        );
+    });
 });