From 29c924f74b692a496606af1759f14d02c5dee9cc Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Tue, 27 Feb 2018 13:30:07 +0100 Subject: Use hard-coded values for paddings and margins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures that the resize tests do not depend on the values set in the CSS files. Note that this change causes a test to fail with Firefox, but not with PhantomJS. This is due to a difference in the starting width used by Firefox and by PhantomJS, and it will be fixed in a following commit. Signed-off-by: Daniel Calviño Sánchez --- apps/files/tests/js/breadcrumbSpec.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/files/tests/js/breadcrumbSpec.js b/apps/files/tests/js/breadcrumbSpec.js index 392d4bf3fe1..b1fd8d11769 100644 --- a/apps/files/tests/js/breadcrumbSpec.js +++ b/apps/files/tests/js/breadcrumbSpec.js @@ -236,7 +236,7 @@ describe('OCA.Files.BreadCrumb tests', function() { }); describe('Resizing', function() { - var bc, dummyDir, widths; + var bc, dummyDir, widths, paddings, margins; // cit() will skip tests if running on PhantomJS because it does not // have proper support for flexboxes. @@ -261,9 +261,15 @@ describe('OCA.Files.BreadCrumb tests', function() { // results on different browsers due to font engine differences // 51px is default size for menu and home widths = [51, 51, 106, 112, 160, 257, 251, 91]; + // using hard-coded paddings and margins to avoid depending on the + // current CSS values used in the server + paddings = [0, 0, 0, 0, 0, 0, 0, 0]; + margins = [0, 0, 0, 0, 0, 0, 0, 0]; $('div.crumb').each(function(index){ $(this).css('width', widths[index]); + $(this).css('padding', paddings[index]); + $(this).css('margin', margins[index]); }); }); afterEach(function() { -- cgit v1.2.3