From a91f4d601d7a4133c7ac0a0c4ca7c551edd872a0 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 12 Mar 2014 22:29:01 +0100 Subject: [PATCH] test for getProgress --- test/test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test.js b/test/test.js index e833bd40..8e5697fc 100644 --- a/test/test.js +++ b/test/test.js @@ -116,6 +116,16 @@ Reveal.addEventListener( 'ready', function() { 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() { ok( typeof Reveal.getScale() === 'number', 'has scale' ); });