浏览代码

add test for loop setting

Hakim El Hattab 10 年之前
父节点
当前提交
5cf49561a8
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      test/test.js

+ 14 - 0
test/test.js

@@ -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