test for getProgress

This commit is contained in:
Hakim El Hattab 2014-03-12 22:29:01 +01:00
parent 6e9a33cf1f
commit a91f4d601d
1 changed files with 10 additions and 0 deletions

View File

@ -116,6 +116,16 @@ Reveal.addEventListener( 'ready', function() {
equal( Reveal.getCurrentSlide(), secondSlide, 'current is slide #1' ); equal( Reveal.getCurrentSlide(), secondSlide, 'current is slide #1' );
}); });
test( 'Reveal.getProgress', function() {
Reveal.slide( 0, 0 );
strictEqual( Reveal.getProgress(), 0, 'progress is 0 on first slide' );
var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
Reveal.slide( lastSlideIndex, 0 );
strictEqual( Reveal.getProgress(), 1, 'progress is 1 on last slide' );
});
test( 'Reveal.getScale', function() { test( 'Reveal.getScale', function() {
ok( typeof Reveal.getScale() === 'number', 'has scale' ); ok( typeof Reveal.getScale() === 'number', 'has scale' );
}); });