Sfoglia il codice sorgente

adding test for hiding messages

El RIDO 8 anni fa
parent
commit
c6e0f2d223
1 ha cambiato i file con 24 aggiunte e 0 eliminazioni
  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');
+            }
+        );
+    });
 });
 });