blowfish/node_modules/packery/test/unit/container-size.js
2023-01-29 22:30:24 +00:00

24 lines
908 B
JavaScript

QUnit.test( 'container size', function( assert ) {
var container = document.querySelector('#container-size');
var pckry = new Packery( container );
assert.equal( container.style.height, '40px', 'default height' );
pckry.options.gutter = 4;
pckry._getMeasurements();
pckry.layout();
assert.equal( container.style.height, '40px', 'added gutter, height same' );
// addPaddingBorders() {
container.style.padding = '1px 2px 3px 4px';
container.style.borderStyle = 'solid';
container.style.borderWidth = '1px 2px 3px 4px';
pckry.layout();
assert.equal( container.style.height, '40px', 'add padding, height same' );
// border box
container.style.WebkitBoxSizing = 'border-box';
container.style.MozBoxSizing = 'border-box';
container.style.boxSizing = 'border-box';
pckry.layout();
assert.equal( container.style.height, '48px', 'border-box, height + padding + border' );
});