From 5e4a52d3c259e77065dbb5f0766b0d08f2e1babb Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 28 Sep 2015 12:30:12 +0200 Subject: Fix tabs order in files sidebar --- apps/files/tests/js/detailsviewSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'apps/files/tests') 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']); + }); }); }); -- cgit v1.2.3