<!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>
						<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() {

				// ---------------------------------------------------------------
				// 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 );

					let event = new KeyboardEvent( 'keydown', { 'keyCode':88 } );
					document.dispatchEvent( event );

					Reveal.removeKeyBinding( 88 );

					// should do nothing
					document.dispatchEvent( event );
				});

				// ---------------------------------------------------------------
				// 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({ loop: false });
				});


				// ---------------------------------------------------------------
				// 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' );

					// 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' );
				});


				// ---------------------------------------------------------------
				// EVENT TESTS

				QUnit.module( 'Events' );

				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>
