-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add selectInitialIndex β initialIndex tests
- Loading branch information
Showing
3 changed files
with
67 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
QUnit.test( 'initialIndex', function( assert ) { | ||
'use strict'; | ||
// initialIndex number | ||
var 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' ); | ||
|
||
}); |