Adds a test to check that the sorting isn't stored without an user

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
Michael Weimann 2018-08-17 20:08:57 +02:00
parent 20aa21c908
commit f18fc851c0
No known key found for this signature in database
GPG Key ID: 34F0524D4DA694A1
1 changed files with 16 additions and 0 deletions

View File

@ -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({