adding test for hiding messages

This commit is contained in:
El RIDO 2017-11-04 07:44:42 +01:00
parent 1fd13981d4
commit c6e0f2d223
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92

View file

@ -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');
}
);
});
}); });