From 85355e98e645698b9433674be7ad01b49fc8f20c Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Wed, 8 Nov 2017 20:12:38 +0100 Subject: Fixed tests and width calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/js/breadcrumb.js | 5 +++-- apps/files/tests/js/breadcrumbSpec.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js index e548084f33f..ccdecbe8204 100644 --- a/apps/files/js/breadcrumb.js +++ b/apps/files/js/breadcrumb.js @@ -260,7 +260,7 @@ for (var i = 0; i < this.breadcrumbs.length; i++ ) { var $crumb = $(this.breadcrumbs[i]); if(!$crumb.hasClass('hidden') || ignoreHidden === true) { - totalWidth += $crumb.width(); + totalWidth += $crumb.outerWidth(); } } return totalWidth; @@ -329,10 +329,11 @@ // Used for testing since this.$el.parent fails if (!this.availableWidth) { - this.usedWidth = this.$el.parent().width(); + this.usedWidth = this.$el.parent().width() - this.$el.next('.actions').width(); } else { this.usedWidth = this.availableWidth; } + console.log(this.usedWidth, this.getTotalWidth()); // If container is smaller than content // AND if there are crumbs left to hide diff --git a/apps/files/tests/js/breadcrumbSpec.js b/apps/files/tests/js/breadcrumbSpec.js index 5765233c0aa..f0489e927eb 100644 --- a/apps/files/tests/js/breadcrumbSpec.js +++ b/apps/files/tests/js/breadcrumbSpec.js @@ -156,7 +156,7 @@ describe('OCA.Files.BreadCrumb tests', function() { onDrop: handler }); bc.setDirectory('/one/two/three/four'); - expect(droppableStub.calledOnce).toEqual(false); + expect(droppableStub.calledOnce).toEqual(true); expect(droppableStub.getCall(0).args[0].drop).toBeDefined(); // simulate drop -- cgit v1.2.3