Use hard-coded values for paddings and margins
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 <danxuliu@gmail.com>
This commit is contained in:
parent
d9405a2b02
commit
89c0a0733f
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue