aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Weimann <mail@michael-weimann.eu>2018-08-17 20:08:57 +0200
committerMichael Weimann <mail@michael-weimann.eu>2018-08-17 20:08:57 +0200
commitf18fc851c00c5cb9cad5b3217b49359f7f2165fc (patch)
tree8916315de13b6c27740880ab5cee97ff0840ed7f
parent20aa21c908e770746b1db4164838749fc53550fb (diff)
downloadnextcloud-server-f18fc851c00c5cb9cad5b3217b49359f7f2165fc.tar.gz
nextcloud-server-f18fc851c00c5cb9cad5b3217b49359f7f2165fc.zip
Adds a test to check that the sorting isn't stored without an user
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
-rw-r--r--apps/files/tests/js/filelistSpec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 7947dd91f2d..d140299d228 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -2614,6 +2614,14 @@ describe('OCA.Files.FileList tests', function() {
});
});
describe('Sorting files', function() {
+
+ /**
+ * Set any user id before tests.
+ */
+ beforeEach(function() {
+ OC.currentUser = 1;
+ });
+
it('Toggles the sort indicator when clicking on a column header', function() {
var ASC_CLASS = fileList.SORT_INDICATOR_ASC_CLASS;
var DESC_CLASS = fileList.SORT_INDICATOR_DESC_CLASS;
@@ -2739,6 +2747,14 @@ describe('OCA.Files.FileList tests', function() {
sortStub.restore();
});
+
+ it('doesn\'t send a sort update request if there is no user logged in', function() {
+ OC.currentUser = false;
+ fileList.$el.find('.column-size .columntitle').click();
+ // check if there was no request
+ expect(fakeServer.requests.length).toEqual(0);
+ });
+
describe('with favorites', function() {
it('shows favorite files on top', function() {
testFiles.push(new FileInfo({