add test for loop setting
authorHakim El Hattab <hakim.elhattab@gmail.com>
Fri, 23 Aug 2013 01:38:37 +0000 (21:38 -0400)
committerHakim El Hattab <hakim.elhattab@gmail.com>
Fri, 23 Aug 2013 01:38:37 +0000 (21:38 -0400)
test/test.js

index ef66ea35f3b182b87bef6f7b222068a64beb2b50..7288b0182f02737a02f22a2bdecca97a486f2d2a 100644 (file)
@@ -186,6 +186,20 @@ Reveal.addEventListener( 'ready', function() {
                equal( progressElement.style.display, 'block', 'progress are visible' );
        });
 
+       test( 'Loop', function() {
+               Reveal.configure({ loop: true });
+
+               Reveal.slide( 0, 0 );
+
+               Reveal.left();
+               notEqual( Reveal.getIndices().h, 0, 'looped from start to end' );
+
+               Reveal.right();
+               equal( Reveal.getIndices().h, 0, 'looped from end to start' );
+
+               Reveal.configure({ loop: false });
+       });
+
 
        // ---------------------------------------------------------------
        // EVENT TESTS