adding test for hiding messages
This commit is contained in:
parent
1fd13981d4
commit
c6e0f2d223
1 changed files with 24 additions and 0 deletions
24
js/test.js
24
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');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue