diff --git a/inst/reveal.js-4.6.1/test/test.html b/inst/reveal.js-4.6.1/test/test.html
new file mode 100644
index 0000000..ab44922
--- /dev/null
+++ b/inst/reveal.js-4.6.1/test/test.html
@@ -0,0 +1,900 @@
+<!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>
+			QUnit.config.testTimeout = 30000;
+
+			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( Reveal.getSlidePath(), '/2' );
+
+					Reveal.slide( 2, 1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/2/1' );
+
+					Reveal.slide( 2, 0, 1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/2' );
+
+					Reveal.slide( 2, 2, 0 );
+					assert.strictEqual( Reveal.getSlidePath(), '/fragments3' );
+
+					Reveal.slide( 2, 2, 1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/fragments3' );
+				});
+
+				QUnit.test( 'Write (fragmentInURL: true)', function( assert ) {
+					Reveal.configure({ hash: true, fragmentInURL: true });
+
+					Reveal.slide( 2, 0, -1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/2' );
+
+					Reveal.slide( 2, 1, -1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/2/1' );
+
+					Reveal.slide( 2, 0, 1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/2/0/1' );
+
+					Reveal.slide( 2, 2, -1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/fragments3' );
+
+					Reveal.slide( 2, 2, 1 );
+					assert.strictEqual( Reveal.getSlidePath(), '/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>
