diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-04-28 11:54:11 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-04-28 11:54:11 +0200 |
commit | 1391253cb815e36e6956553791f3a25f74923c95 (patch) | |
tree | a6bfd29828455a20dd23de30826b5f4e0d4c769f /test/test.js | |
parent | 635e51f8f54ba519c7b865b7b4f62cb65a927d2f (diff) | |
download | freenode-live-2017-presentation-1391253cb815e36e6956553791f3a25f74923c95.tar freenode-live-2017-presentation-1391253cb815e36e6956553791f3a25f74923c95.tar.gz |
test same conditions for both getSlide and getSlideBackground
Diffstat (limited to 'test/test.js')
-rw-r--r-- | test/test.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test.js b/test/test.js index c0c25fb..00f9080 100644 --- a/test/test.js +++ b/test/test.js @@ -106,11 +106,13 @@ Reveal.addEventListener( 'ready', function() { }); test( 'Reveal.getSlide', function() { - var firstSlide = document.querySelector( '.reveal .slides>section:first-child' ); - - equal( Reveal.getSlide( 0 ), firstSlide, 'gets correct first slide' ); + equal( Reveal.getSlide( 0 ), document.querySelector( '.reveal .slides>section:first-child' ), 'gets correct first slide' ); + equal( Reveal.getSlide( 1 ), document.querySelector( '.reveal .slides>section:nth-child(2)' ), 'no v index returns stack' ); + equal( Reveal.getSlide( 1, 0 ), document.querySelector( '.reveal .slides>section:nth-child(2)>section:nth-child(1)' ), 'v index 0 returns first vertical child' ); + equal( Reveal.getSlide( 1, 1 ), document.querySelector( '.reveal .slides>section:nth-child(2)>section:nth-child(2)' ), 'v index 1 returns second vertical child' ); - strictEqual( Reveal.getSlide( 100 ), undefined, 'returns undefined when slide can\'t be found' ); + strictEqual( Reveal.getSlide( 100 ), undefined, 'undefined when out of horizontal bounds' ); + strictEqual( Reveal.getSlide( 1, 100 ), undefined, 'undefined when out of vertical bounds' ); }); test( 'Reveal.getSlideBackground', function() { |