mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-24 07:25:40 -06:00
37 lines
1,010 B
JavaScript
37 lines
1,010 B
JavaScript
|
QUnit.test( 'consecutive', function( assert ) {
|
||
|
var container = document.querySelector('#consecutive');
|
||
|
var pckry = new Packery( container );
|
||
|
|
||
|
var i0 = container.querySelector('.i0');
|
||
|
var i1 = container.querySelector('.i1');
|
||
|
var i3 = container.querySelector('.i3');
|
||
|
i1.style.width = '28px';
|
||
|
i1.style.height = '28px';
|
||
|
i1.style.background = 'blue';
|
||
|
|
||
|
var done = assert.async();
|
||
|
|
||
|
pckry.once( 'layoutComplete', function() {
|
||
|
assert.ok( true, 'layoutComplete triggered' );
|
||
|
assert.equal( i3.style.left, '0px', 'i3.style.left' );
|
||
|
assert.equal( i3.style.top, '20px', 'i3.style.top' );
|
||
|
setTimeout( fit1 );
|
||
|
});
|
||
|
|
||
|
pckry.layout();
|
||
|
|
||
|
function fit1() {
|
||
|
pckry.once( 'layoutComplete', function() {
|
||
|
assert.equal( i3.style.left, '60px', 'i3.style.left' );
|
||
|
assert.equal( i3.style.top, '30px', 'i3.style.top' );
|
||
|
// all done
|
||
|
done();
|
||
|
});
|
||
|
i0.style.width = '38px';
|
||
|
i0.style.height = '38px';
|
||
|
i0.style.background = 'orange';
|
||
|
pckry.layout();
|
||
|
}
|
||
|
|
||
|
});
|