mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 02:39:46 +02:00
25 lines
884 B
JavaScript
25 lines
884 B
JavaScript
QUnit.test( 'initialIndex', function( assert ) {
|
|
// initialIndex number
|
|
let flkty = new Flickity( '#initial-index', {
|
|
initialIndex: 3,
|
|
} );
|
|
assert.equal( flkty.selectedIndex, 3, 'initialIndex number' );
|
|
// selectedIndex remains same after reactivation
|
|
flkty.deactivate();
|
|
flkty.activate();
|
|
assert.equal( flkty.selectedIndex, 3, 'reactivated selectedIndex stays the same' );
|
|
flkty.destroy();
|
|
// initialIndex selector string
|
|
flkty = new Flickity( '#initial-index', {
|
|
initialIndex: '.cell--initial',
|
|
} );
|
|
assert.equal( flkty.selectedIndex, 4, 'initialIndex selector string' );
|
|
flkty.destroy();
|
|
// initialIndex selector string with groupCells #881
|
|
flkty = new Flickity( '#initial-index', {
|
|
groupCells: 3,
|
|
initialIndex: '.cell--initial',
|
|
} );
|
|
assert.equal( flkty.selectedIndex, 1, 'initialIndex selector string with groupCells' );
|
|
|
|
} );
|