1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 10:49:36 +02:00
Oinktube/node_modules/flickity/test/unit/adaptive-height.js
2023-06-30 09:56:13 -03:00

28 lines
677 B
JavaScript

QUnit.test( 'adaptiveHeight', function( assert ) {
let flkty = new Flickity( '#adaptive-height', {
adaptiveHeight: true,
} );
// 2,1,3, 1,4,2, 1,2,1
function checkSelectHeight( index, height ) {
flkty.select( index, false, true );
assert.equal( flkty.viewport.style.height, `${height}px`, `slide ${index}` );
}
checkSelectHeight( 0, 200 );
checkSelectHeight( 1, 100 );
checkSelectHeight( 2, 300 );
checkSelectHeight( 3, 100 );
checkSelectHeight( 4, 400 );
checkSelectHeight( 5, 200 );
flkty.options.groupCells = true;
flkty.resize();
checkSelectHeight( 0, 300 );
checkSelectHeight( 1, 400 );
checkSelectHeight( 2, 200 );
} );