aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfabiano <fabianorosas@gmail.com>2014-05-09 12:28:53 -0300
committerfabiano <fabianorosas@gmail.com>2014-05-09 15:37:57 -0300
commitaf1ade14187c50a0e8d7ca954dfd1ae7d3043456 (patch)
treee2caba9abb1e82429bb0b6e3f2c5283cec15b006 /test
parent92fd4f78c86ea296ceb90c748f088674a5a12c5f (diff)
downloadperl-software-in-gnu-guix-af1ade14187c50a0e8d7ca954dfd1ae7d3043456.tar
perl-software-in-gnu-guix-af1ade14187c50a0e8d7ca954dfd1ae7d3043456.tar.gz
Broaden the coverage of isFirstSlide test
If we: - visit a vertical slide and then: - go to the first slide the function will return **false**. Added a test to isLastSlide too just to be sure.
Diffstat (limited to 'test')
-rw-r--r--test/test.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test.js b/test/test.js
index 7406aea..fd7b865 100644
--- a/test/test.js
+++ b/test/test.js
@@ -68,6 +68,12 @@ Reveal.addEventListener( 'ready', function() {
strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
});
+ test( 'Reveal.isFirstSlide after vertical slide', function() {
+ Reveal.slide( 1, 1 );
+ Reveal.slide( 0, 0 );
+ strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( 0, 0 )' );
+ });
+
test( 'Reveal.isLastSlide', function() {
Reveal.slide( 0, 0 );
strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
@@ -81,6 +87,14 @@ Reveal.addEventListener( 'ready', function() {
strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
});
+ test( 'Reveal.isLastSlide after vertical slide', function() {
+ var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
+
+ Reveal.slide( 1, 1 );
+ Reveal.slide( lastSlideIndex, 0 );
+ strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( '+ lastSlideIndex +', 0 )' );
+ });
+
test( 'Reveal.getTotalSlides', function() {
strictEqual( Reveal.getTotalSlides(), 8, 'eight slides in total' );
});