include info about which slide the assertion applies to

This commit is contained in:
Hakim El Hattab 2013-08-22 19:46:35 -04:00
parent f61ee9a693
commit d49ff9aa5f

View file

@ -30,24 +30,26 @@ Reveal.addEventListener( 'ready', function() {
test( 'Reveal.isFirstSlide', function() { test( 'Reveal.isFirstSlide', function() {
Reveal.slide( 0 ); Reveal.slide( 0 );
ok( Reveal.isFirstSlide() === true, 'returns true' ); ok( Reveal.isFirstSlide() === true, 'returns true after Reveal.slide( 0 )' );
Reveal.slide( 1 ); Reveal.slide( 1 );
ok( Reveal.isFirstSlide() === false, 'returns false after navigation' ); ok( Reveal.isFirstSlide() === false, 'returns false after Reveal.slide( 1 )' );
Reveal.slide( 0 ); Reveal.slide( 0 );
ok( Reveal.isFirstSlide() === true, 'returns true after navigation' ); ok( Reveal.isFirstSlide() === true, 'returns true after Reveal.slide( 0 )' );
}); });
test( 'Reveal.isLastSlide', function() { test( 'Reveal.isLastSlide', function() {
Reveal.slide( 0 ); Reveal.slide( 0 );
ok( Reveal.isLastSlide() === false, 'returns false' ); ok( Reveal.isLastSlide() === false, 'returns false after Reveal.slide( 0 )' );
Reveal.slide( document.querySelectorAll( '.reveal .slides>section' ).length - 1 ); var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
ok( Reveal.isLastSlide() === true, 'returns true after navigation' );
Reveal.slide( lastSlideIndex );
ok( Reveal.isLastSlide() === true, 'returns true after Reveal.slide( '+ lastSlideIndex +' )' );
Reveal.slide( 0 ); Reveal.slide( 0 );
ok( Reveal.isLastSlide() === false, 'returns false after navigation' ); ok( Reveal.isLastSlide() === false, 'returns false after Reveal.slide( 0 )' );
}); });
test( 'Reveal.getIndices', function() { test( 'Reveal.getIndices', function() {