diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-02-11 10:52:39 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2020-02-11 10:52:39 +0100 |
commit | 6e4c36b3db438f23d697eb8cc28f3c29f8b665b2 (patch) | |
tree | 6388b6e64d48620994a6fc3981733153691d20fc /test | |
parent | 1da222aca6e0004ad1b9aa3141e649072cc4f960 (diff) | |
download | fosdem-2021-minimalism-presentation-6e4c36b3db438f23d697eb8cc28f3c29f8b665b2.tar fosdem-2021-minimalism-presentation-6e4c36b3db438f23d697eb8cc28f3c29f8b665b2.tar.gz |
more auto-animate tests
Diffstat (limited to 'test')
-rw-r--r-- | test/test-auto-animate.html | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/test/test-auto-animate.html b/test/test-auto-animate.html index 2fe7758..2d75710 100644 --- a/test/test-auto-animate.html +++ b/test/test-auto-animate.html @@ -26,7 +26,7 @@ </section> <section data-auto-animate> - <h1>h1</h1> + <h1 data-auto-animate-duration="0.3">h1</h1> <h2 style="opacity: 0;">h2</h2> <h3 style="position: absolute; left: 100px;">h3</h2> </section> @@ -60,22 +60,22 @@ } ); QUnit.test( 'Adds data-auto-animate-target', assert => { - Reveal.next(); + Reveal.slide(1); assert.strictEqual( slides[0].h1.getAttribute( 'data-auto-animate-target' ), '', 'From elements have blank data-auto-animate-target' ); assert.ok( slides[1].h1.getAttribute( 'data-auto-animate-target' ).length > 0, 'To elements have a data-auto-animate-target value' ); }); QUnit.test( 'Ends on correct target styles', assert => { - Reveal.next(); + Reveal.slide(1); assert.strictEqual( slides[1].h2.style.opacity, "0" ); assert.strictEqual( slides[1].h3.offsetLeft, 100 ); }); - QUnit.test( 'data-auto-animate-duration', assert => { - assert.timeout( 400 ); + QUnit.test( 'Slide specific data-auto-animate-duration', assert => { + assert.timeout( 350 ); var done = assert.async(); - Reveal.next(); + Reveal.slide(2); slides[2].h3.addEventListener( 'transitionend', function() { assert.ok( true, 'Transition ended within time window' ); @@ -83,6 +83,18 @@ } ); }); + QUnit.test( 'Element specific data-auto-animate-duration', assert => { + assert.timeout( 350 ); + var done = assert.async(); + + Reveal.slide(1); + + slides[1].h1.addEventListener( 'transitionend', function() { + assert.ok( true, 'Transition ended within time window' ); + done(); + } ); + }); + } ); Reveal.initialize(); |