aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2018-10-11 11:24:54 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2018-10-11 11:24:54 +0200
commita4dc1c64400bea2f88b175fce7a8d0a009209d37 (patch)
tree0105a1fbd67a301c112bf9e374da418f976b1bd1 /test
parent62cd74a890ea3b150c77482d746a716d5001a323 (diff)
downloadperl-software-in-gnu-guix-a4dc1c64400bea2f88b175fce7a8d0a009209d37.tar
perl-software-in-gnu-guix-a4dc1c64400bea2f88b175fce7a8d0a009209d37.tar.gz
fix #1590
Diffstat (limited to 'test')
-rw-r--r--test/test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test.js b/test/test.js
index f8515a0..6e862e8 100644
--- a/test/test.js
+++ b/test/test.js
@@ -262,6 +262,8 @@ Reveal.addEventListener( 'ready', function() {
QUnit.test( 'Current fragment', function( assert ) {
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
+ var fragments = fragmentSlide.querySelectorAll( '.fragment' );
+ var lastFragmentIndex = fragments[ fragments.length - 1 ].getAttribute( 'data-fragment-index' );
Reveal.slide( 2, 0 );
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment at index -1' );
@@ -274,6 +276,10 @@ Reveal.addEventListener( 'ready', function() {
Reveal.slide( 3, 0, 0 );
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to next slide' );
+
+ Reveal.slide( 2, 1, -1 );
+ Reveal.prev();
+ assert.strictEqual( fragmentSlide.querySelector( '.fragment.current-fragment' ).getAttribute( 'data-fragment-index' ), lastFragmentIndex, 'last fragment is current fragment when returning from future slide' );
});
QUnit.test( 'Stepping through fragments', function( assert ) {