Skip to content

Commit

Permalink
Merge pull request #24023 from nextcloud/dependachristoph/npm_and_yar…
Browse files Browse the repository at this point in the history
…n/jquery-3.1.0

Bump jquery from 2.2.4 to 3.1.0
  • Loading branch information
GretaD authored Nov 13, 2020
2 parents 2e91ccc + ae0a496 commit a4223b0
Show file tree
Hide file tree
Showing 29 changed files with 459 additions and 381 deletions.
2 changes: 1 addition & 1 deletion apps/files/js/dist/sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files/js/dist/sidebar.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -3699,7 +3699,7 @@
const enabled = tabView.canDisplay || undefined
if (tabView.id) {
OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({
id: tabView.id,
id: tabView.id,
name: tabView.getLabel(),
icon: tabView.getIcon(),
mount: function(el, fileInfo) {
Expand Down
29 changes: 0 additions & 29 deletions apps/files/tests/js/breadcrumbSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,35 +207,6 @@ describe('OCA.Files.BreadCrumb tests', function() {
bc = null;
});

it('Opens and closes the menu on click', function() {
// Menu exists
expect($popovermenu.length).toEqual(1);

// Disable jQuery delay
jQuery.fx.off = true

// Click on menu
$crumbmenuLink.click();
expect($popovermenu.is(':visible')).toEqual(true);

// Click on home
$(document).mouseup();
expect($popovermenu.is(':visible')).toEqual(false);

// Change directory and reset elements
bc.setDirectory('/one/two/three/four/five/six/seven/eight/nine/ten');
$crumbmenuLink = bc.$el.find('.crumbmenu > a');
$popovermenu = $crumbmenuLink.next('.popovermenu');

// Click on menu again
$crumbmenuLink.click();
expect($popovermenu.is(':visible')).toEqual(true);

// Click on home again
$(document).mouseup();
expect($popovermenu.is(':visible')).toEqual(false);

});
it('Shows only items not in the breadcrumb', function() {
var hiddenCrumbs = bc.$el.find('.crumb:not(.crumbmenu).hidden');
expect($popovermenu.find('li:not(.in-breadcrumb)').length).toEqual(hiddenCrumbs.length);
Expand Down
40 changes: 22 additions & 18 deletions apps/files/tests/js/favoritesfilelistspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('OCA.Files.FavoritesFileList tests', function() {
fileList.destroy();
fileList = undefined;
});
it('render files', function() {
it('render files', function(done) {
var deferred = $.Deferred();
fetchStub.returns(deferred.promise());

Expand All @@ -77,23 +77,27 @@ describe('OCA.Files.FavoritesFileList tests', function() {
mimetype: 'text/plain'
}]);

var $rows = fileList.$el.find('tbody tr');
var $tr = $rows.eq(0);
expect($rows.length).toEqual(1);
expect($tr.attr('data-id')).toEqual('7');
expect($tr.attr('data-type')).toEqual('file');
expect($tr.attr('data-file')).toEqual('test.txt');
expect($tr.attr('data-path')).toEqual('/somedir');
expect($tr.attr('data-size')).toEqual('123');
expect(parseInt($tr.attr('data-permissions'), 10))
.toEqual(OC.PERMISSION_ALL);
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.find('a.name').attr('href')).toEqual(
OC.getRootPath() +
'/remote.php/webdav/somedir/test.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('test.txt');
setTimeout(function() {
var $rows = fileList.$el.find('tbody tr');
var $tr = $rows.eq(0);
expect($rows.length).toEqual(1);
expect($tr.attr('data-id')).toEqual('7');
expect($tr.attr('data-type')).toEqual('file');
expect($tr.attr('data-file')).toEqual('test.txt');
expect($tr.attr('data-path')).toEqual('/somedir');
expect($tr.attr('data-size')).toEqual('123');
expect(parseInt($tr.attr('data-permissions'), 10))
.toEqual(OC.PERMISSION_ALL);
expect($tr.attr('data-mime')).toEqual('text/plain');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.find('a.name').attr('href')).toEqual(
OC.getRootPath() +
'/remote.php/webdav/somedir/test.txt'
);
expect($tr.find('.nametext').text().trim()).toEqual('test.txt');

done();
}, 0);
});
});
});
20 changes: 12 additions & 8 deletions apps/files/tests/js/fileUploadSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ describe('OC.Upload tests', function() {
});
describe('Upload conflicts', function() {
var conflictDialogStub;
var clock;
var fileList;

beforeEach(function() {
Expand Down Expand Up @@ -162,6 +163,11 @@ describe('OC.Upload tests', function() {
deferred.resolve();
});
afterEach(function() {
if (clock) {
clock.restore();
clock = undefined
}

conflictDialogStub.restore();

fileList.destroy();
Expand Down Expand Up @@ -210,7 +216,7 @@ describe('OC.Upload tests', function() {
expect(result[1].submit.calledOnce).toEqual(false);
expect(result[2].submit.calledOnce).toEqual(true);
done();
}, 0);
}, 10);
});
var result = addFiles(uploader, [
{name: 'conflict.txt'},
Expand Down Expand Up @@ -251,8 +257,6 @@ describe('OC.Upload tests', function() {
uploader.onReplace(upload);
});
it('autorenames file when choosing replace in conflict mode', function(done) {
// needed for _.defer call
var clock = sinon.useFakeTimers();
var fileData = {name: 'conflict.txt'};
var uploadData = addFiles(uploader, [
fileData
Expand All @@ -272,15 +276,15 @@ describe('OC.Upload tests', function() {
expect(uploadData[0].submit.calledOnce).toEqual(true);
getResponseStatusStub.returns(412);
uploader.fileUploadParam.fail.call($dummyUploader[0], {}, uploadData[0]);
clock.tick(500);
}
if(counter===2)
{
expect(upload.getFileName()).toEqual('conflict (3).txt');
expect(uploadData[0].submit.calledTwice).toEqual(true);
_.defer(function() {
expect(upload.getFileName()).toEqual('conflict (3).txt');
expect(uploadData[0].submit.calledTwice).toEqual(true);

clock.restore();
done();
done();
})
}
});

Expand Down
Loading

0 comments on commit a4223b0

Please sign in to comment.