diff --git a/inst/reveal.js-4.2.1/test/test.html b/inst/reveal.js-4.2.1/test/test.html
new file mode 100644
index 0000000..d326f01
--- /dev/null
+++ b/inst/reveal.js-4.2.1/test/test.html
@@ -0,0 +1,898 @@
+<!doctype html>
+<html lang="en">
+
+	<head>
+		<meta charset="utf-8">
+
+		<title>reveal.js - Tests</title>
+
+		<link rel="stylesheet" href="../dist/reveal.css">
+		<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
+		<script src="../node_modules/qunit/qunit/qunit.js"></script>
+	</head>
+
+	<body style="overflow: auto;">
+
+		<div id="qunit"></div>
+  		<div id="qunit-fixture"></div>
+
+		<div class="reveal" style="visibility: hidden;">
+
+			<div class="slides">
+
+				<section data-visibility="hidden">
+					This should be remove by reveal.js before our tests run.
+				</section>
+
+				<section data-background-image="examples/assets/image1.png">
+					<h1>1</h1>
+					<img data-src="">
+					<video data-src=""></video>
+					<audio data-src=""></audio>
+					<aside class="notes">speaker notes 1</aside>
+				</section>
+
+				<section>
+					<section data-background="examples/assets/image2.png" data-notes="speaker notes 2">
+						<h1>2.1</h1>
+					</section>
+					<section data-background-image="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/">
+						<h1>2.2</h1>
+					</section>
+					<section>
+						<h1>2.3</h1>
+					</section>
+				</section>
+
+				<section id="fragment-slides">
+					<section>
+						<h1>3.1</h1>
+						<ul>
+							<li class="fragment">4.1</li>
+							<li class="fragment">4.2</li>
+							<li class="fragment">4.3</li>
+						</ul>
+					</section>
+
+					<section>
+						<h1>3.2</h1>
+						<ul>
+							<li class="fragment" data-fragment-index="0">4.1</li>
+							<li class="fragment" data-fragment-index="0">4.2</li>
+						</ul>
+						<iframe data-src="http://example.com"></iframe>
+					</section>
+
+					<section id="fragments3">
+						<h1>3.3</h1>
+						<ul>
+							<li class="fragment" data-fragment-index="1">3.3.1</li>
+							<li class="fragment" data-fragment-index="4">3.3.2</li>
+							<li class="fragment" data-fragment-index="4">3.3.3</li>
+						</ul>
+					</section>
+				</section>
+
+				<section>
+					<h1>4</h1>
+				</section>
+
+			</div>
+
+		</div>
+
+		<script src="../dist/reveal.js"></script>
+		<script>
+			window.location.hash = '';
+
+			Reveal.configure({maxScale: 1.11});
+
+			// These tests expect the DOM to contain a presentation
+			// with the following slide structure:
+			//
+			// 1
+			// 2 - Three sub-slides
+			// 3 - Three fragment elements
+			// 3 - Two fragments with same data-fragment-index
+			// 4
+			Reveal.initialize().then( function() {
+
+				// Helper methods
+				function triggerKeyboardEvent(config) {
+					document.dispatchEvent( new KeyboardEvent( 'keydown', config ) );
+				}
+
+				// ---------------------------------------------------------------
+				// DOM TESTS
+
+				QUnit.module( 'DOM' );
+
+				QUnit.test( 'Initial slides classes', function( assert ) {
+					var horizontalSlides = document.querySelectorAll( '.reveal .slides>section' )
+
+					assert.strictEqual( document.querySelectorAll( '.reveal .slides section[data-visibility="hidden"]' ).length, 0, 'no data-visibility="hidden" slides' );
+					assert.strictEqual( document.querySelectorAll( '.reveal .slides section.past' ).length, 0, 'no .past slides' );
+					assert.strictEqual( document.querySelectorAll( '.reveal .slides section.present' ).length, 1, 'one .present slide' );
+					assert.strictEqual( document.querySelectorAll( '.reveal .slides>section.future' ).length, horizontalSlides.length - 1, 'remaining horizontal slides are .future' );
+
+					assert.strictEqual( document.querySelectorAll( '.reveal .slides section.stack' ).length, 2, 'two .stacks' );
+
+					assert.ok( document.querySelectorAll( '.reveal .slides section.stack' )[0].querySelectorAll( '.future' ).length > 0, 'vertical slides are given .future' );
+				});
+
+				// ---------------------------------------------------------------
+				// API TESTS
+
+				QUnit.module( 'API' );
+
+				QUnit.test( 'Reveal.configure before initialization', function( assert ) {
+					assert.strictEqual( Reveal.getConfig().maxScale, 1.11 );
+				});
+
+				QUnit.test( 'Reveal.isReady', function( assert ) {
+					assert.strictEqual( Reveal.isReady(), true, 'returns true' );
+				});
+
+				QUnit.test( 'Reveal.isOverview', function( assert ) {
+					assert.strictEqual( Reveal.isOverview(), false, 'false by default' );
+
+					Reveal.toggleOverview();
+					assert.strictEqual( Reveal.isOverview(), true, 'true after toggling on' );
+
+					Reveal.toggleOverview();
+					assert.strictEqual( Reveal.isOverview(), false, 'false after toggling off' );
+				});
+
+				QUnit.test( 'Reveal.isPaused', function( assert ) {
+					assert.strictEqual( Reveal.isPaused(), false, 'false by default' );
+
+					Reveal.togglePause();
+					assert.strictEqual( Reveal.isPaused(), true, 'true after pausing' );
+
+					Reveal.togglePause();
+					assert.strictEqual( Reveal.isPaused(), false, 'false after resuming' );
+				});
+
+				QUnit.test( 'Reveal.isFirstSlide', function( assert ) {
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
+
+					Reveal.slide( 1, 0 );
+					assert.strictEqual( Reveal.isFirstSlide(), false, 'false after Reveal.slide( 1, 0 )' );
+
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
+				});
+
+				QUnit.test( 'Reveal.isFirstSlide after vertical slide', function( assert ) {
+					Reveal.slide( 1, 1 );
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( 0, 0 )' );
+				});
+
+				QUnit.test( 'Reveal.isLastSlide', function( assert ) {
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
+
+					var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
+
+					Reveal.slide( lastSlideIndex, 0 );
+					assert.strictEqual( Reveal.isLastSlide(), true, 'true after Reveal.slide( '+ lastSlideIndex +', 0 )' );
+
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
+				});
+
+				QUnit.test( 'Reveal.isLastSlide after vertical slide', function( assert ) {
+					var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
+
+					Reveal.slide( 1, 1 );
+					Reveal.slide( lastSlideIndex );
+					assert.strictEqual( Reveal.isLastSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( '+ lastSlideIndex +', 0 )' );
+				});
+
+				QUnit.test( 'Reveal.getTotalSlides', function( assert ) {
+					assert.strictEqual( Reveal.getTotalSlides(), 8, 'eight slides in total' );
+				});
+
+				QUnit.test( 'Reveal.getIndices', function( assert ) {
+					var indices = Reveal.getIndices();
+
+					assert.ok( indices.hasOwnProperty( 'h' ), 'h exists' );
+					assert.ok( indices.hasOwnProperty( 'v' ), 'v exists' );
+					assert.ok( indices.hasOwnProperty( 'f' ), 'f exists' );
+
+					Reveal.slide( 1, 0 );
+					assert.strictEqual( Reveal.getIndices().h, 1, 'h 1' );
+					assert.strictEqual( Reveal.getIndices().v, 0, 'v 0' );
+
+					Reveal.slide( 1, 2 );
+					assert.strictEqual( Reveal.getIndices().h, 1, 'h 1' );
+					assert.strictEqual( Reveal.getIndices().v, 2, 'v 2' );
+
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( Reveal.getIndices().h, 0, 'h 0' );
+					assert.strictEqual( Reveal.getIndices().v, 0, 'v 0' );
+				});
+
+				QUnit.test( 'Reveal.getSlide', function( assert ) {
+					assert.equal( Reveal.getSlide( 0 ), document.querySelector( '.reveal .slides>section:first-child' ), 'gets correct first slide' );
+					assert.equal( Reveal.getSlide( 1 ), document.querySelector( '.reveal .slides>section:nth-child(2)' ), 'no v index returns stack' );
+					assert.equal( Reveal.getSlide( 1, 0 ), document.querySelector( '.reveal .slides>section:nth-child(2)>section:nth-child(1)' ), 'v index 0 returns first vertical child' );
+					assert.equal( Reveal.getSlide( 1, 1 ), document.querySelector( '.reveal .slides>section:nth-child(2)>section:nth-child(2)' ), 'v index 1 returns second vertical child' );
+
+					assert.strictEqual( Reveal.getSlide( 100 ), undefined, 'undefined when out of horizontal bounds' );
+					assert.strictEqual( Reveal.getSlide( 1, 100 ), undefined, 'undefined when out of vertical bounds' );
+				});
+
+				QUnit.test( 'Reveal.getSlideBackground', function( assert ) {
+					assert.equal( Reveal.getSlideBackground( 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:first-child' ), 'gets correct first background' );
+					assert.equal( Reveal.getSlideBackground( 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2)' ), 'no v index returns stack' );
+					assert.equal( Reveal.getSlideBackground( 1, 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(2)' ), 'v index 0 returns first vertical child' );
+					assert.equal( Reveal.getSlideBackground( 1, 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(3)' ), 'v index 1 returns second vertical child' );
+
+					assert.strictEqual( Reveal.getSlideBackground( 100 ), undefined, 'undefined when out of horizontal bounds' );
+					assert.strictEqual( Reveal.getSlideBackground( 1, 100 ), undefined, 'undefined when out of vertical bounds' );
+				});
+
+				QUnit.test( 'Reveal.getSlideNotes', function( assert ) {
+					Reveal.slide( 0, 0 );
+					assert.ok( Reveal.getSlideNotes() === 'speaker notes 1', 'works with <aside class="notes">' );
+
+					Reveal.slide( 1, 0 );
+					assert.ok( Reveal.getSlideNotes() === 'speaker notes 2', 'works with <section data-notes="">' );
+				});
+
+				QUnit.test( 'Reveal.getPreviousSlide/getCurrentSlide', function( assert ) {
+					Reveal.slide( 0, 0 );
+					Reveal.slide( 1, 0 );
+
+					var firstSlide = document.querySelector( '.reveal .slides>section:first-child' );
+					var secondSlide = document.querySelector( '.reveal .slides>section:nth-child(2)>section' );
+
+					assert.equal( Reveal.getPreviousSlide(), firstSlide, 'previous is slide #0' );
+					assert.equal( Reveal.getCurrentSlide(), secondSlide, 'current is slide #1' );
+				});
+
+				QUnit.test( 'Reveal.getProgress', function( assert ) {
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( Reveal.getProgress(), 0, 'progress is 0 on first slide' );
+
+					var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
+
+					Reveal.slide( lastSlideIndex, 0 );
+					assert.strictEqual( Reveal.getProgress(), 1, 'progress is 1 on last slide' );
+				});
+
+				QUnit.test( 'Reveal.getScale', function( assert ) {
+					assert.ok( typeof Reveal.getScale() === 'number', 'has scale' );
+				});
+
+				QUnit.test( 'Reveal.getConfig', function( assert ) {
+					assert.ok( typeof Reveal.getConfig() === 'object', 'has config' );
+				});
+
+				QUnit.test( 'Reveal.configure', function( assert ) {
+					assert.strictEqual( Reveal.getConfig().loop, false, '"loop" is false to start with' );
+
+					Reveal.configure({ loop: true });
+					assert.strictEqual( Reveal.getConfig().loop, true, '"loop" has changed to true' );
+
+					Reveal.configure({ loop: false, customTestValue: 1 });
+					assert.strictEqual( Reveal.getConfig().customTestValue, 1, 'supports custom values' );
+				});
+
+				QUnit.test( 'Reveal.availableRoutes', function( assert ) {
+					Reveal.slide( 0, 0 );
+					assert.deepEqual( Reveal.availableRoutes(), { left: false, up: false, down: false, right: true }, 'correct for first slide' );
+
+					Reveal.slide( 1, 0 );
+					assert.deepEqual( Reveal.availableRoutes(), { left: true, up: false, down: true, right: true }, 'correct for vertical slide' );
+
+					Reveal.slide( 0, 0 );
+					assert.deepEqual( Reveal.availableRoutes({ includeFragments: true }), { left: false, up: false, down: false, right: true }, 'correct with fragments included' );
+				});
+
+				QUnit.test( 'Reveal.next', function( assert ) {
+					Reveal.slide( 0, 0 );
+
+					// Step through vertical child slides
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 1, v: 0, f: undefined } );
+
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 1, v: 1, f: undefined } );
+
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined } );
+
+					// Step through fragments
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 } );
+
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 } );
+
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 } );
+
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 } );
+				});
+
+				QUnit.test( 'Reveal.next at end', function( assert ) {
+					Reveal.slide( 3 );
+
+					// We're at the end, this should have no effect
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
+
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
+				});
+
+
+				// ---------------------------------------------------------------
+				// URL TESTS
+
+				QUnit.module( 'URL' );
+
+				QUnit.test( 'Write (fragmentInURL: false)', function( assert ) {
+					Reveal.configure({ hash: true, fragmentInURL: false });
+
+					Reveal.slide( 2, 0 );
+					assert.strictEqual( window.location.hash, '#/2' );
+
+					Reveal.slide( 2, 1 );
+					assert.strictEqual( window.location.hash, '#/2/1' );
+
+					Reveal.slide( 2, 0, 1 );
+					assert.strictEqual( window.location.hash, '#/2' );
+
+					Reveal.slide( 2, 2, 0 );
+					assert.strictEqual( window.location.hash, '#/fragments3' );
+
+					Reveal.slide( 2, 2, 1 );
+					assert.strictEqual( window.location.hash, '#/fragments3' );
+				});
+
+				QUnit.test( 'Write (fragmentInURL: true)', function( assert ) {
+					Reveal.configure({ hash: true, fragmentInURL: true });
+
+					Reveal.slide( 2, 0, -1 );
+					assert.strictEqual( window.location.hash, '#/2' );
+
+					Reveal.slide( 2, 1, -1 );
+					assert.strictEqual( window.location.hash, '#/2/1' );
+
+					Reveal.slide( 2, 0, 1 );
+					assert.strictEqual( window.location.hash, '#/2/0/1' );
+
+					Reveal.slide( 2, 2, -1 );
+					assert.strictEqual( window.location.hash, '#/fragments3' );
+
+					Reveal.slide( 2, 2, 1 );
+					assert.strictEqual( window.location.hash, '#/fragments3/1' );
+				});
+
+				QUnit.test( 'Read', async function( assert ) {
+					Reveal.configure({ hash: true, fragmentInURL: true });
+
+					let test = function( hash, indices ) {
+						return new Promise( resolve => {
+							window.onhashchange = () => {
+								assert.deepEqual( Reveal.getIndices(), indices );
+								resolve();
+							};
+							window.location.hash = hash;
+						} );
+					}
+
+					await test( '#/0', { h: 0, v: 0, f: undefined } ); // horizontal
+					await test( '#/1/1', { h: 1, v: 1, f: undefined } ); // vertical
+					await test( '#/0/', { h: 0, v: 0, f: undefined } ); // trailing /
+					await test( '#/1/1/', { h: 1, v: 1, f: undefined } ); // trailing /
+					await test( '#/2/0/1', { h: 2, v: 0, f: 1 } ); // fragment
+				});
+
+				// ---------------------------------------------------------------
+				// KEYBOARD TESTS
+
+				QUnit.module( 'Keyboard' );
+
+				QUnit.test( 'Add key bindings', function( assert ) {
+					var done = assert.async( 1 );
+
+					Reveal.addKeyBinding({keyCode: 88, key: 'X', description: 'X-SHORTCUT-X'}, function() {
+						assert.ok( true, 'callback triggered' );
+						done();
+					} );
+
+					Reveal.toggleHelp( true );
+					assert.ok( /X\-SHORTCUT\-X/.test( document.body.innerHTML ), 'binding is added to help overlay' );
+					Reveal.toggleHelp( false );
+
+					triggerKeyboardEvent({ keyCode: 88 });
+
+					Reveal.removeKeyBinding( 88 );
+
+					// should do nothing
+					triggerKeyboardEvent({ keyCode: 88 });
+				});
+
+				QUnit.test( 'Navigation bindings', function( assert ) {
+					Reveal.slide( 0 );
+
+					// right arrow
+					triggerKeyboardEvent({ keyCode: 39 });
+					assert.strictEqual( Reveal.getIndices().h, 1 );
+
+					// down arrow + shift
+					triggerKeyboardEvent({ keyCode: 40, shiftKey: true });
+					assert.strictEqual( Reveal.getIndices().v, 2, 'shift + down arrow goes to last vertical slide' );
+
+					// up arrow
+					triggerKeyboardEvent({ keyCode: 38 });
+					assert.strictEqual( Reveal.getIndices().v, 1 );
+
+					// right arrow + shift
+					triggerKeyboardEvent({ keyCode: 39, shiftKey: true });
+					assert.ok( Reveal.isLastSlide(), 'shift + right arrow goes to last horizontal slide' );
+
+
+					// right arrow on slide with fragments
+					Reveal.slide( 2, 0, -1 );
+					triggerKeyboardEvent({ keyCode: 39 });
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'right arrow shows fragment' );
+
+					triggerKeyboardEvent({ keyCode: 39, altKey: true });
+					assert.strictEqual( Reveal.getIndices().h, 3, 'right arrow skips fragments when alt key is pressed' );
+				});
+
+				// ---------------------------------------------------------------
+				// FRAGMENT TESTS
+
+				QUnit.module( 'Fragments' );
+
+				QUnit.test( 'Sliding to fragments', function( assert ) {
+					Reveal.slide( 2, 0, -1 );
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 }, 'Reveal.slide( 2, 0, -1 )' );
+
+					Reveal.slide( 2, 0, 0 );
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'Reveal.slide( 2, 0, 0 )' );
+
+					Reveal.slide( 2, 0, 2 );
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'Reveal.slide( 2, 0, 2 )' );
+
+					Reveal.slide( 2, 0, 1 );
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'Reveal.slide( 2, 0, 1 )' );
+				});
+
+				QUnit.test( 'data-fragment is set on slide <section>', function( assert ) {
+					Reveal.slide( 2, 0, -1 );
+					assert.deepEqual( Reveal.getCurrentSlide().getAttribute( 'data-fragment' ), '-1' );
+
+					Reveal.slide( 2, 0, 2 );
+					assert.deepEqual( Reveal.getCurrentSlide().getAttribute( 'data-fragment' ), '2' );
+
+					Reveal.slide( 2, 0, 0 );
+					assert.deepEqual( Reveal.getCurrentSlide().getAttribute( 'data-fragment' ), '0' );
+
+					var fragmentSlide = Reveal.getCurrentSlide();
+
+					Reveal.slide( 3, 0 );
+					assert.deepEqual( fragmentSlide.getAttribute( 'data-fragment' ), '0', 'data-fragment persists when jumping to another slide' );
+				});
+
+				QUnit.test( 'Hiding all fragments', function( assert ) {
+					var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
+
+					Reveal.slide( 2, 0, 0 );
+					assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 1, 'one fragment visible when index is 0' );
+
+					Reveal.slide( 2, 0, -1 );
+					assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when index is -1' );
+				});
+
+				QUnit.test( 'Current fragment', function( assert ) {
+					var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
+					var lastFragmentIndex = [].slice.call( fragmentSlide.querySelectorAll( '.fragment' ) ).pop().getAttribute( 'data-fragment-index' );
+
+					Reveal.slide( 2, 0 );
+					assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment at index -1' );
+
+					Reveal.slide( 2, 0, 0 );
+					assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 1, 'one current fragment at index 0' );
+
+					Reveal.slide( 1, 0, 0 );
+					assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to previous slide' );
+
+					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 ) {
+					Reveal.slide( 2, 0, -1 );
+
+					// forwards:
+
+					Reveal.next();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'next() goes to next fragment' );
+
+					Reveal.right();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'right() goes to next fragment' );
+
+					Reveal.down();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'down() goes to next fragment' );
+
+					Reveal.down(); // moves to f #3
+
+					// backwards:
+
+					Reveal.prev();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'prev() goes to prev fragment' );
+
+					Reveal.left();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'left() goes to prev fragment' );
+
+					Reveal.up();
+					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'up() goes to prev fragment' );
+				});
+
+				QUnit.test( 'Stepping past fragments', function( assert ) {
+					var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
+
+					Reveal.slide( 0, 0, 0 );
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when on previous slide' );
+
+					Reveal.slide( 3, 0, 0 );
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 3, 'all fragments visible when on future slide' );
+				});
+
+				QUnit.test( 'Fragment indices', function( assert ) {
+					var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(2)' );
+
+					Reveal.slide( 3, 0, 0 );
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 2, 'both fragments of same index are shown' );
+
+					// This slide has three fragments, first one is index 0, second and third have index 1
+					Reveal.slide( 2, 2, 0 );
+					assert.equal( Reveal.getIndices().f, 0, 'returns correct index for first fragment' );
+
+					Reveal.slide( 2, 2, 1 );
+					assert.equal( Reveal.getIndices().f, 1, 'returns correct index for two fragments with same index' );
+				});
+
+				QUnit.test( 'Index generation', function( assert ) {
+					var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
+
+					// These have no indices defined to start with
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '2' );
+				});
+
+				QUnit.test( 'Index normalization', function( assert ) {
+					var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(3)' );
+
+					// These start out as 1-4-4 and should normalize to 0-1-1
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
+					assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '1' );
+				});
+
+				QUnit.test( 'fragmentshown event', function( assert ) {
+					assert.expect( 2 );
+					var done = assert.async( 2 );
+
+					var _onEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'fragmentshown', _onEvent );
+
+					Reveal.slide( 2, 0 );
+					Reveal.slide( 2, 0 ); // should do nothing
+					Reveal.slide( 2, 0, 0 ); // should do nothing
+					Reveal.next();
+					Reveal.next();
+					Reveal.prev(); // shouldn't fire fragmentshown
+
+					Reveal.off( 'fragmentshown', _onEvent );
+				});
+
+				QUnit.test( 'fragmenthidden event', function( assert ) {
+					assert.expect( 2 );
+					var done = assert.async( 2 );
+
+					var _onEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'fragmenthidden', _onEvent );
+
+					Reveal.slide( 2, 0, 2 );
+					Reveal.slide( 2, 0, 2 ); // should do nothing
+					Reveal.prev();
+					Reveal.prev();
+					Reveal.next(); // shouldn't fire fragmenthidden
+
+					Reveal.off( 'fragmenthidden', _onEvent );
+				});
+
+
+				// ---------------------------------------------------------------
+				// AUTO-SLIDE TESTS
+
+				QUnit.module( 'Auto Sliding' );
+
+				QUnit.test( 'Reveal.isAutoSliding', function( assert ) {
+					assert.strictEqual( Reveal.isAutoSliding(), false, 'false by default' );
+
+					Reveal.configure({ autoSlide: 10000 });
+					assert.strictEqual( Reveal.isAutoSliding(), true, 'true after starting' );
+
+					Reveal.configure({ autoSlide: 0 });
+					assert.strictEqual( Reveal.isAutoSliding(), false, 'false after setting to 0' );
+				});
+
+				QUnit.test( 'Reveal.toggleAutoSlide', function( assert ) {
+					Reveal.configure({ autoSlide: 10000 });
+
+					Reveal.toggleAutoSlide();
+					assert.strictEqual( Reveal.isAutoSliding(), false, 'false after first toggle' );
+					Reveal.toggleAutoSlide();
+					assert.strictEqual( Reveal.isAutoSliding(), true, 'true after second toggle' );
+
+					Reveal.configure({ autoSlide: 0 });
+				});
+
+				QUnit.test( 'autoslidepaused', function( assert ) {
+					assert.expect( 1 );
+					var done = assert.async();
+
+					var _onEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'autoslidepaused', _onEvent );
+					Reveal.configure({ autoSlide: 10000 });
+					Reveal.toggleAutoSlide();
+
+					// cleanup
+					Reveal.configure({ autoSlide: 0 });
+					Reveal.off( 'autoslidepaused', _onEvent );
+				});
+
+				QUnit.test( 'autoslideresumed', function( assert ) {
+					assert.expect( 1 );
+					var done = assert.async();
+
+					var _onEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'autoslideresumed', _onEvent );
+					Reveal.configure({ autoSlide: 10000 });
+					Reveal.toggleAutoSlide();
+					Reveal.toggleAutoSlide();
+
+					// cleanup
+					Reveal.configure({ autoSlide: 0 });
+					Reveal.off( 'autoslideresumed', _onEvent );
+				});
+
+
+				// ---------------------------------------------------------------
+				// CONFIGURATION VALUES
+
+				QUnit.module( 'Configuration' );
+
+				QUnit.test( 'Controls', function( assert ) {
+					var controlsElement = document.querySelector( '.reveal>.controls' );
+
+					Reveal.configure({ controls: false });
+					assert.equal( controlsElement.style.display, 'none', 'controls are hidden' );
+
+					Reveal.configure({ controls: true });
+					assert.equal( controlsElement.style.display, 'block', 'controls are visible' );
+				});
+
+				QUnit.test( 'Progress', function( assert ) {
+					var progressElement = document.querySelector( '.reveal>.progress' );
+
+					Reveal.configure({ progress: false });
+					assert.equal( progressElement.style.display, 'none', 'progress are hidden' );
+
+					Reveal.configure({ progress: true });
+					assert.equal( progressElement.style.display, 'block', 'progress are visible' );
+				});
+
+				QUnit.test( 'Loop', function( assert ) {
+					Reveal.configure({ loop: true });
+
+					Reveal.slide( 0, 0 );
+
+					Reveal.left();
+					assert.notEqual( Reveal.getIndices().h, 0, 'looped from start to end' );
+
+					Reveal.right();
+					assert.equal( Reveal.getIndices().h, 0, 'looped from end to start' );
+
+					Reveal.configure({ navigationMode: 'linear' });
+					Reveal.slide( 0, 0 );
+
+					Reveal.prev();
+					assert.notEqual( Reveal.getIndices().h, 0, 'looped from start to end in linear mode' );
+
+					Reveal.next();
+					assert.equal( Reveal.getIndices().h, 0, 'looped from end to start in linear mode' );
+
+					Reveal.configure({ loop: false, navigationMode: 'default' });
+				});
+
+
+				// ---------------------------------------------------------------
+				// LAZY-LOADING TESTS
+
+				QUnit.module( 'Lazy-Loading' );
+
+				QUnit.test( 'img with data-src', function( assert ) {
+					assert.strictEqual( document.querySelectorAll( '.reveal section img[src]' ).length, 1, 'Image source has been set' );
+				});
+
+				QUnit.test( 'video with data-src', function( assert ) {
+					assert.strictEqual( document.querySelectorAll( '.reveal section video[src]' ).length, 1, 'Video source has been set' );
+				});
+
+				QUnit.test( 'audio with data-src', function( assert ) {
+					assert.strictEqual( document.querySelectorAll( '.reveal section audio[src]' ).length, 1, 'Audio source has been set' );
+				});
+
+				QUnit.test( 'iframe with data-src', function( assert ) {
+					Reveal.slide( 0, 0 );
+					assert.strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
+					Reveal.slide( 2, 1 );
+					assert.strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 1, 'Iframe source is set' );
+					Reveal.slide( 2, 2 );
+					assert.strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
+				});
+
+				QUnit.test( 'background images', function( assert ) {
+					var imageSource1 = Reveal.getSlide( 0 ).getAttribute( 'data-background-image' );
+					var imageSource2 = Reveal.getSlide( 1, 0 ).getAttribute( 'data-background' );
+					var imageSource3 = Reveal.getSlide( 1, 1 ).getAttribute( 'data-background-image' );
+
+					// check that the images are applied to the background elements
+					assert.ok( Reveal.getSlideBackground( 0 ).querySelector( '.slide-background-content' ).style.backgroundImage.indexOf( imageSource1 ) !== -1, 'data-background-image worked' );
+					assert.ok( Reveal.getSlideBackground( 1, 0 ).querySelector( '.slide-background-content' ).style.backgroundImage.indexOf( imageSource2 ) !== -1, 'data-background worked' );
+					assert.ok( Reveal.getSlideBackground( 1, 1 ).querySelector( '.slide-background-content' ).style.backgroundImage.indexOf( imageSource3 ) !== -1, 'data-background worked' );
+				});
+
+
+				// ---------------------------------------------------------------
+				// EVENT TESTS
+
+				QUnit.module( 'Events' );
+
+				QUnit.test( 'beforeslidechange', function( assert ) {
+					var done = assert.async( 2 );
+
+					var normalEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+					var blockingEvent = function( event ) {
+						event.preventDefault();
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'beforeslidechange', normalEvent );
+					Reveal.slide( 2, 0 );
+					Reveal.off( 'beforeslidechange', normalEvent );
+
+					Reveal.on( 'beforeslidechange', blockingEvent );
+					Reveal.slide( 3, 0 );
+					Reveal.off( 'beforeslidechange', blockingEvent );
+
+					assert.strictEqual( Reveal.getIndices().h, 2, 'preventing "beforeslidechange" blocks navigation ' );
+
+				});
+
+				QUnit.test( 'slidechanged', function( assert ) {
+					assert.expect( 3 );
+					var done = assert.async( 3 );
+
+					var _onEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'slidechanged', _onEvent );
+
+					Reveal.slide( 1, 0 ); // should trigger
+					Reveal.slide( 1, 0 ); // should do nothing
+					Reveal.next(); // should trigger
+					Reveal.slide( 3, 0 ); // should trigger
+					Reveal.next(); // should do nothing
+
+					Reveal.off( 'slidechanged', _onEvent );
+
+				});
+
+				/* Fails intermittently...
+				QUnit.test( 'slidetransitionend', function( assert ) {
+					assert.expect( 2 );
+					let done = assert.async( 2 );
+					let time = Date.now();
+
+					let horizontalCallback = event => {
+						assert.ok( Date.now() - time > 200, 'horizontal event fired' );
+						done();
+
+						let verticalCallback = event => {
+							assert.ok( true, 'vertical event fired' );
+							done();
+							Reveal.off( 'slidetransitionend', verticalCallback );
+						}
+
+						Reveal.off( 'slidetransitionend', horizontalCallback );
+						Reveal.on( 'slidetransitionend', verticalCallback );
+						Reveal.slide( 1, 1 );
+					}
+
+					Reveal.slide( 0, 0 );
+					Reveal.on( 'slidetransitionend', horizontalCallback );
+					Reveal.slide( 1, 0 );
+
+				});
+				*/
+
+				QUnit.test( 'paused', function( assert ) {
+					assert.expect( 1 );
+					var done = assert.async();
+
+					var _onEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'paused', _onEvent );
+
+					Reveal.togglePause();
+					Reveal.togglePause();
+
+					Reveal.off( 'paused', _onEvent );
+				});
+
+				QUnit.test( 'resumed', function( assert ) {
+					assert.expect( 1 );
+					var done = assert.async();
+
+					var _onEvent = function( event ) {
+						assert.ok( true, 'event fired' );
+						done();
+					}
+
+					Reveal.on( 'resumed', _onEvent );
+
+					Reveal.togglePause();
+					Reveal.togglePause();
+
+					Reveal.off( 'resumed', _onEvent );
+				});
+
+			} );
+		</script>
+
+	</body>
+</html>
