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/select-cell.js
2023-06-30 09:56:13 -03:00

17 lines
648 B
JavaScript

QUnit.test( 'selectCell', function( assert ) {
let gallery = document.querySelector('#select-cell');
let cellElems = gallery.querySelectorAll('.cell');
let flkty = new Flickity( gallery, {
groupCells: true, // groups of 3
} );
flkty.selectCell( 3 );
assert.equal( flkty.selectedIndex, 1, 'selectCell number' );
flkty.selectCell( cellElems[1] );
assert.equal( flkty.selectedIndex, 0, 'selectCell element' );
flkty.selectCell('.select-cell__6');
assert.equal( flkty.selectedIndex, 2, 'selectCell selector string' );
flkty.selectCell('none');
assert.equal( flkty.selectedIndex, 2, 'selectCell bad string is okay' );
} );