diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-02-17 10:19:47 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-02-17 10:19:47 +0100 |
commit | ac59dcb5259f486c9dd3378b087e634148b0c06e (patch) | |
tree | 120e55ccef83ea49cdf5fb22409b52d379d032ac /test | |
parent | f263f2819d0eade350a6fefd74bad1a5d0a3c5e5 (diff) | |
download | fosdem-2021-minimalism-presentation-ac59dcb5259f486c9dd3378b087e634148b0c06e.tar fosdem-2021-minimalism-presentation-ac59dcb5259f486c9dd3378b087e634148b0c06e.tar.gz |
additional auto-animate tests
Diffstat (limited to 'test')
-rw-r--r-- | test/test-auto-animate.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test-auto-animate.html b/test/test-auto-animate.html index 116e4d4..60c32f4 100644 --- a/test/test-auto-animate.html +++ b/test/test-auto-animate.html @@ -52,6 +52,7 @@ const slides = Array.prototype.map.call( document.querySelectorAll( '.slides section' ), slide => { return { + slide: slide, h1: slide.querySelector( 'h1' ), h2: slide.querySelector( 'h2' ), h3: slide.querySelector( 'h3' ) @@ -102,6 +103,23 @@ slides[1].h1.addEventListener( 'transitionend', callback ); }); + QUnit.test( 'Does not add [data-auto-animate] on non auto-animated slides', assert => { + Reveal.slide(2); + Reveal.next(); + assert.ok( slides[3].slide.hasAttribute( 'data-auto-animate' ) === false ) + }); + + QUnit.test( 'autoAnimate config option', assert => { + Reveal.configure({ autoAnimate: false }); + + assert.ok( document.querySelectorAll( 'data-auto-animate-target' ).length === 0, 'Removes all [data-auto-animate-target]' ) + assert.ok( Array.prototype.every.call( document.querySelectorAll( 'section[data-auto-animate]' ), el => { + return el.dataset.autoAnimate === ''; + }, 'All data-auto-animate attributes are reset' ) ); + + Reveal.configure({ autoAnimate: true }); + }); + } ); Reveal.initialize(); |