From 6e4c36b3db438f23d697eb8cc28f3c29f8b665b2 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 11 Feb 2020 10:52:39 +0100 Subject: [PATCH] more auto-animate tests --- test/test-auto-animate.html | 24 ++++++++++++++++++------ 1 file 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 @@
-

h1

+

h1

h2

h3

@@ -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();