deprecated functions, fix test partially

This commit is contained in:
El RIDO 2022-02-20 21:07:04 +01:00
parent fbf0eae513
commit a0f8a667ae
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 6 additions and 8 deletions

View File

@ -110,4 +110,3 @@ describe('DiscussionViewer', function () {
); );
}); });
}); });

View File

@ -52,12 +52,12 @@ describe('Editor', function () {
!$.PrivateBin.Editor.isPreview() && !$.PrivateBin.Editor.isPreview() &&
!$('#message').hasClass('hidden') !$('#message').hasClass('hidden')
); );
$('#messagepreview').click(); $('#messagepreview').trigger('click');
results.push( results.push(
$.PrivateBin.Editor.isPreview() && $.PrivateBin.Editor.isPreview() &&
$('#message').hasClass('hidden') $('#message').hasClass('hidden')
); );
$('#messageedit').click(); $('#messageedit').trigger('click');
results.push( results.push(
!$.PrivateBin.Editor.isPreview() && !$.PrivateBin.Editor.isPreview() &&
!$('#message').hasClass('hidden') !$('#message').hasClass('hidden')
@ -68,4 +68,3 @@ describe('Editor', function () {
); );
}); });
}); });

View File

@ -280,7 +280,8 @@ describe('TopNav', function () {
it( it(
'collapses the navigation when displayed on a small screen', 'collapses the navigation when displayed on a small screen',
function () { function () {
var results = []; var clean = jsdom(),
results = [];
$('body').html( $('body').html(
'<nav><div class="navbar-header"><button type="button" ' + '<nav><div class="navbar-header"><button type="button" ' +
'class="navbar-toggle collapsed" data-toggle="collapse" ' + 'class="navbar-toggle collapsed" data-toggle="collapse" ' +
@ -301,7 +302,7 @@ describe('TopNav', function () {
$('.navbar-toggle').hasClass('collapsed') && $('.navbar-toggle').hasClass('collapsed') &&
$('#navbar').attr('aria-expanded') != 'true' $('#navbar').attr('aria-expanded') != 'true'
); );
$('.navbar-toggle').click(); $('.navbar-toggle').trigger('click');
results.push( results.push(
!$('.navbar-toggle').hasClass('collapsed') && !$('.navbar-toggle').hasClass('collapsed') &&
$('#navbar').attr('aria-expanded') == 'true' $('#navbar').attr('aria-expanded') == 'true'
@ -311,7 +312,7 @@ describe('TopNav', function () {
$('.navbar-toggle').hasClass('collapsed') && $('.navbar-toggle').hasClass('collapsed') &&
$('#navbar').attr('aria-expanded') == 'false' $('#navbar').attr('aria-expanded') == 'false'
); );
cleanup(); clean();
assert.ok(results.every(element => element)); assert.ok(results.every(element => element));
} }
); );
@ -670,4 +671,3 @@ describe('TopNav', function () {
); );
}); });
}); });