test isAutoSliding, isAutoSliding returns false when no autoSlide value is set #766

This commit is contained in:
Hakim El Hattab 2013-12-21 17:33:30 +01:00
parent 137ddf5472
commit ed4cdaf9e7
3 changed files with 13 additions and 3 deletions

View File

@ -1471,7 +1471,7 @@ var Reveal = (function(){
*/
function isAutoSliding() {
return !autoSlidePaused;
return !!( autoSlide && !autoSlidePaused );
}

4
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -57,6 +57,16 @@ Reveal.addEventListener( 'ready', function() {
strictEqual( Reveal.isPaused(), false, 'false after resuming' );
});
test( 'Reveal.isAutoSliding', function() {
strictEqual( Reveal.isAutoSliding(), false, 'false by default' );
Reveal.configure({ autoSlide: 10000 });
strictEqual( Reveal.isAutoSliding(), true, 'true after starting' );
Reveal.configure({ autoSlide: 0 });
strictEqual( Reveal.isAutoSliding(), false, 'false after setting to 0' );
});
test( 'Reveal.isFirstSlide', function() {
Reveal.slide( 0, 0 );
strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );