summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-28 12:55:38 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-28 12:55:38 +0200
commit72024ad201dd9f232eee5ab57d8e08ccecb7179a (patch)
treeff85dd4e5f1c6359da66770aba5db8ef03540a3a /apps/files/tests
parentd007c32907fbd0f11e8866b9f735d8eab78b06d9 (diff)
parent5e4a52d3c259e77065dbb5f0766b0d08f2e1babb (diff)
downloadnextcloud-server-72024ad201dd9f232eee5ab57d8e08ccecb7179a.tar.gz
nextcloud-server-72024ad201dd9f232eee5ab57d8e08ccecb7179a.zip
Merge pull request #19404 from owncloud/files-sidebar-sorttabs
Fix tabs order in files sidebar
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/detailsviewSpec.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files/tests/js/detailsviewSpec.js b/apps/files/tests/js/detailsviewSpec.js
index 852f8b04293..f02e419434f 100644
--- a/apps/files/tests/js/detailsviewSpec.js
+++ b/apps/files/tests/js/detailsviewSpec.js
@@ -153,5 +153,20 @@ describe('OCA.Files.DetailsView tests', function() {
expect(detailsView.$el.find('.tabHeader').length).toEqual(0);
});
+ it('sorts by order and then label', function() {
+ detailsView.remove();
+ detailsView = new OCA.Files.DetailsView();
+ detailsView.addTabView(new OCA.Files.DetailTabView({id: 'abc', order: 20}));
+ detailsView.addTabView(new OCA.Files.DetailTabView({id: 'def', order: 10}));
+ detailsView.addTabView(new OCA.Files.DetailTabView({id: 'jkl'}));
+ detailsView.addTabView(new OCA.Files.DetailTabView({id: 'ghi'}));
+ detailsView.render();
+
+ var tabs = detailsView.$el.find('.tabHeader').map(function() {
+ return $(this).attr('data-tabid');
+ }).toArray();
+
+ expect(tabs).toEqual(['ghi', 'jkl', 'def', 'abc']);
+ });
});
});