From bae6e6ff25d6e04bafd1246371d80058d07b60ae Mon Sep 17 00:00:00 2001 From: Ankiiisharma Date: Sat, 18 May 2024 00:09:23 +0530 Subject: [PATCH] Added test case to verify rawText Added test case to verify rawText manipulates button visibility correctly --- js/test/TopNav.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/js/test/TopNav.js b/js/test/TopNav.js index d5571888..e0797d1f 100644 --- a/js/test/TopNav.js +++ b/js/test/TopNav.js @@ -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( + '' + ); + }); + + 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(); + }); + }); + + });