test: Copilots tries at fixing tests

This commit is contained in:
rugk
2026-03-01 15:22:05 +00:00
parent 48678638d0
commit ea4f5ba920
2 changed files with 4 additions and 4 deletions

View File

@@ -98,7 +98,7 @@ describe('AttachmentViewer', function () {
(previewSupported ? !$('#attachmentPreview').hasClass('hidden') : $('#attachmentPreview').hasClass('hidden'))
);
let element = $('<div>');
$.PrivateBin.AttachmentViewer.moveAttachmentTo(element, attachment[0], prefix + '%s' + postfix);
$.PrivateBin.AttachmentViewer.moveAttachmentTo(element[0], attachment[0], prefix + '%s' + postfix);
// messageIDs with links get a relaxed treatment
if (prefix.indexOf('<a') === -1 && postfix.indexOf('<a') === -1) {
result = $('<textarea>').text((prefix + filename + postfix)).text();

View File

@@ -88,7 +88,7 @@ describe('Helper', function () {
$('body').html('<div id="foo"></div>');
let e = $('#foo');
e.text(content);
$.PrivateBin.Helper.urls2links(e);
$.PrivateBin.Helper.urls2links(e[0]);
let result = e.text();
clean();
return content === result;
@@ -121,7 +121,7 @@ describe('Helper', function () {
postfix = '';
}
e.text(prefix + urlString + postfix);
$.PrivateBin.Helper.urls2links(e);
$.PrivateBin.Helper.urls2links(e[0]);
let result = e.html();
clean();
urlString = $('<div />').text(urlString).html();
@@ -144,7 +144,7 @@ describe('Helper', function () {
$('body').html('<div id="foo"></div>');
let e = $('#foo');
e.text(prefix + url + postfix);
$.PrivateBin.Helper.urls2links(e);
$.PrivateBin.Helper.urls2links(e[0]);
let result = e.html();
clean();
url = $('<div />').text(url).html();