mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-24 22:45:10 -04:00
test: Copilot generated new simpler test cases
This commit is contained in:
@@ -5,6 +5,22 @@ describe('PasteViewer', function () {
|
||||
describe('run, hide, getText, setText, getFormat, setFormat & isPrettyPrinted', function () {
|
||||
this.timeout(30000);
|
||||
|
||||
it('basic plaintext display works', function () {
|
||||
const clean = jsdom();
|
||||
$('body').html(
|
||||
'<div id="placeholder" class="hidden">+++ no document text +++</div>' +
|
||||
'<div id="prettymessage" class="hidden"><pre id="prettyprint" class="prettyprint linenums:1"></pre></div>' +
|
||||
'<div id="plaintext" class="hidden"></div>'
|
||||
);
|
||||
PrivateBin.PasteViewer.init();
|
||||
PrivateBin.PasteViewer.setFormat('plaintext');
|
||||
PrivateBin.PasteViewer.setText('hello');
|
||||
PrivateBin.PasteViewer.run();
|
||||
assert.strictEqual(PrivateBin.PasteViewer.getText(), 'hello');
|
||||
assert.ok(!$('#plaintext').hasClass('hidden'));
|
||||
clean();
|
||||
});
|
||||
|
||||
jsc.property(
|
||||
'displays text according to format',
|
||||
common.jscFormats(),
|
||||
|
||||
Reference in New Issue
Block a user