Skip to content

Commit

Permalink
Merge pull request #1338 from ankiiisharma/ankit#1336
Browse files Browse the repository at this point in the history
Added test case to verify rawText
  • Loading branch information
elrido committed May 18, 2024
2 parents 2324e83 + bae6e6f commit 39a359c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions js/test/TopNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,48 @@ describe('TopNav', function () {
}
);
});

describe('rawText', function () {
before(function () {
// Insert any setup code needed for the rawText function
// Example: Initialize the DOM elements required for testing
$('body').html(
'<nav class="navbar navbar-inverse navbar-static-top">' +
'<div id="navbar" class="navbar-collapse collapse"><ul ' +
'class="nav navbar-nav"><li><button id="newbutton" ' +
'type="button" class="hidden btn btn-warning navbar-btn">' +
'<span class="glyphicon glyphicon-file" aria-hidden="true">' +
'</span> New</button><button id="clonebutton" type="button"' +
' class="hidden btn btn-warning navbar-btn">' +
'<span class="glyphicon glyphicon-duplicate" ' +
'aria-hidden="true"></span> Clone</button><button ' +
'id="rawtextbutton" type="button" class="hidden btn ' +
'btn-warning navbar-btn"><span class="glyphicon ' +
'glyphicon-text-background" aria-hidden="true"></span> ' +
'Raw text</button><button id="qrcodelink" type="button" ' +
'data-toggle="modal" data-target="#qrcodemodal" ' +
'class="hidden btn btn-warning navbar-btn"><span ' +
'class="glyphicon glyphicon-qrcode" aria-hidden="true">' +
'</span> QR code</button></li></ul></div></nav>'
);
});

it(
'displays raw text view correctly',
function () {
rawText();

assert.ok($('#newbutton').hasClass('hidden'));
assert.ok($('#clonebutton').hasClass('hidden'));
assert.ok(!$('#rawtextbutton').hasClass('hidden'));
assert.ok($('#qrcodelink').hasClass('hidden'));
}
);

after(function () {
$('body').empty();
});
});


});

0 comments on commit 39a359c

Please sign in to comment.