From d52361b09b3960d962f59b03a7aa178b45efa5b1 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 29 Sep 2015 13:24:33 +0200 Subject: Disable sorting when multiselect is enabled in file list --- apps/files/tests/js/filelistSpec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'apps/files/tests') diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index c05e7c37214..31e5c410270 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2156,6 +2156,25 @@ describe('OCA.Files.FileList tests', function() { expect(fileList.files.length).toEqual(5); expect(fileList.$fileList.find('tr').length).toEqual(5); }); + it('does not sort when clicking on header whenever multiselect is enabled', function() { + var sortStub = sinon.stub(OCA.Files.FileList.prototype, 'setSort'); + + fileList.setFiles(testFiles); + fileList.findFileEl('One.txt').find('input:checkbox:first').click(); + + fileList.$el.find('.column-size .columntitle').click(); + + expect(sortStub.notCalled).toEqual(true); + + // can sort again after deselecting + fileList.findFileEl('One.txt').find('input:checkbox:first').click(); + + fileList.$el.find('.column-size .columntitle').click(); + + expect(sortStub.calledOnce).toEqual(true); + + sortStub.restore(); + }); }); describe('create file', function() { var deferredCreate; -- cgit v1.2.3