reveal-ck 3.8.1 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/files/reveal.js/Gruntfile.js +41 -40
- data/files/reveal.js/LICENSE +1 -1
- data/files/reveal.js/README.md +189 -107
- data/files/reveal.js/bower.json +2 -2
- data/files/reveal.js/css/print/pdf.css +10 -18
- data/files/reveal.js/css/reveal.css +344 -140
- data/files/reveal.js/css/reveal.scss +371 -76
- data/files/reveal.js/css/theme/README.md +2 -2
- data/files/reveal.js/css/theme/beige.css +19 -38
- data/files/reveal.js/css/theme/black.css +19 -38
- data/files/reveal.js/css/theme/blood.css +19 -38
- data/files/reveal.js/css/theme/league.css +19 -38
- data/files/reveal.js/css/theme/moon.css +19 -38
- data/files/reveal.js/css/theme/night.css +19 -38
- data/files/reveal.js/css/theme/serif.css +19 -38
- data/files/reveal.js/css/theme/simple.css +19 -38
- data/files/reveal.js/css/theme/sky.css +19 -38
- data/files/reveal.js/css/theme/solarized.css +19 -38
- data/files/reveal.js/css/theme/template/theme.scss +18 -45
- data/files/reveal.js/css/theme/white.css +19 -38
- data/files/reveal.js/demo.html +13 -7
- data/files/reveal.js/js/reveal.js +707 -242
- data/files/reveal.js/lib/js/head.min.js +1 -4
- data/files/reveal.js/package.json +16 -17
- data/files/reveal.js/plugin/highlight/highlight.js +3 -4
- data/files/reveal.js/plugin/markdown/example.html +7 -0
- data/files/reveal.js/plugin/markdown/example.md +5 -0
- data/files/reveal.js/plugin/markdown/markdown.js +1 -1
- data/files/reveal.js/plugin/math/math.js +4 -4
- data/files/reveal.js/plugin/multiplex/master.js +4 -1
- data/files/reveal.js/plugin/multiplex/package.json +1 -1
- data/files/reveal.js/plugin/notes/notes.html +48 -2
- data/files/reveal.js/plugin/notes/notes.js +9 -17
- data/files/reveal.js/plugin/print-pdf/print-pdf.js +9 -11
- data/files/reveal.js/plugin/search/search.js +127 -117
- data/files/reveal.js/plugin/zoom-js/zoom.js +16 -32
- data/files/reveal.js/test/qunit-2.5.0.css +436 -0
- data/files/reveal.js/test/qunit-2.5.0.js +5188 -0
- data/files/reveal.js/test/test-markdown-element-attributes.html +2 -2
- data/files/reveal.js/test/test-markdown-element-attributes.js +21 -23
- data/files/reveal.js/test/test-markdown-external.html +3 -3
- data/files/reveal.js/test/test-markdown-external.js +7 -11
- data/files/reveal.js/test/test-markdown-options.html +2 -2
- data/files/reveal.js/test/test-markdown-options.js +7 -6
- data/files/reveal.js/test/test-markdown-slide-attributes.html +2 -2
- data/files/reveal.js/test/test-markdown-slide-attributes.js +23 -26
- data/files/reveal.js/test/test-markdown.html +2 -2
- data/files/reveal.js/test/test-markdown.js +2 -6
- data/files/reveal.js/test/test-pdf.html +2 -2
- data/files/reveal.js/test/test-pdf.js +2 -5
- data/files/reveal.js/test/test.html +2 -2
- data/files/reveal.js/test/test.js +184 -188
- data/lib/reveal-ck/version.rb +1 -1
- metadata +4 -4
- data/files/reveal.js/test/qunit-1.12.0.css +0 -244
- data/files/reveal.js/test/qunit-1.12.0.js +0 -2212
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>reveal.js - Test Markdown Element Attributes</title>
|
8
8
|
|
9
9
|
<link rel="stylesheet" href="../css/reveal.css">
|
10
|
-
<link rel="stylesheet" href="qunit-
|
10
|
+
<link rel="stylesheet" href="qunit-2.5.0.css">
|
11
11
|
</head>
|
12
12
|
|
13
13
|
<body style="overflow: auto;">
|
@@ -126,7 +126,7 @@
|
|
126
126
|
<script src="../js/reveal.js"></script>
|
127
127
|
<script src="../plugin/markdown/marked.js"></script>
|
128
128
|
<script src="../plugin/markdown/markdown.js"></script>
|
129
|
-
<script src="qunit-
|
129
|
+
<script src="qunit-2.5.0.js"></script>
|
130
130
|
|
131
131
|
<script src="test-markdown-element-attributes.js"></script>
|
132
132
|
|
@@ -1,46 +1,44 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
Reveal.addEventListener( 'ready', function() {
|
4
2
|
|
5
3
|
QUnit.module( 'Markdown' );
|
6
4
|
|
7
|
-
test( 'Vertical separator', function() {
|
8
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' );
|
5
|
+
QUnit.test( 'Vertical separator', function( assert ) {
|
6
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' );
|
9
7
|
});
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.
|
14
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' );
|
9
|
+
QUnit.test( 'Attributes on element header in vertical slides', function( assert ) {
|
10
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' );
|
11
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' );
|
15
12
|
});
|
16
13
|
|
17
|
-
test( 'Attributes on element paragraphs in vertical slides', function() {
|
18
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' );
|
14
|
+
QUnit.test( 'Attributes on element paragraphs in vertical slides', function( assert ) {
|
15
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' );
|
19
16
|
});
|
20
17
|
|
21
|
-
test( 'Attributes on element list items in vertical slides', function() {
|
22
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.grow' ).length, 3, 'found a vertical slide with three list items with class fragment.grow' );
|
18
|
+
QUnit.test( 'Attributes on element list items in vertical slides', function( assert ) {
|
19
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.grow' ).length, 3, 'found a vertical slide with three list items with class fragment.grow' );
|
23
20
|
});
|
24
21
|
|
25
|
-
test( 'Attributes on element paragraphs in horizontal slides', function() {
|
26
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' );
|
22
|
+
QUnit.test( 'Attributes on element paragraphs in horizontal slides', function( assert ) {
|
23
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' );
|
27
24
|
});
|
28
|
-
|
29
|
-
|
25
|
+
|
26
|
+
QUnit.test( 'Attributes on element list items in horizontal slides', function( assert ) {
|
27
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section li.fragment.highlight-green' ).length, 5, 'found a horizontal slide with five list items with class fragment.roll-in' );
|
30
28
|
});
|
31
|
-
|
32
|
-
|
29
|
+
|
30
|
+
QUnit.test( 'Attributes on element image in horizontal slides', function( assert ) {
|
31
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' );
|
33
32
|
});
|
34
33
|
|
35
|
-
test( 'Attributes on elements in vertical slides with default element attribute separator', function() {
|
36
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' );
|
34
|
+
QUnit.test( 'Attributes on elements in vertical slides with default element attribute separator', function( assert ) {
|
35
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' );
|
37
36
|
});
|
38
37
|
|
39
|
-
test( 'Attributes on elements in single slides with default element attribute separator', function() {
|
40
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' );
|
38
|
+
QUnit.test( 'Attributes on elements in single slides with default element attribute separator', function( assert ) {
|
39
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' );
|
41
40
|
});
|
42
41
|
|
43
42
|
} );
|
44
43
|
|
45
44
|
Reveal.initialize();
|
46
|
-
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>reveal.js - Test Markdown</title>
|
8
8
|
|
9
9
|
<link rel="stylesheet" href="../css/reveal.css">
|
10
|
-
<link rel="stylesheet" href="qunit-
|
10
|
+
<link rel="stylesheet" href="qunit-2.5.0.css">
|
11
11
|
</head>
|
12
12
|
|
13
13
|
<body style="overflow: auto;">
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<div class="reveal" style="display: none;">
|
19
19
|
|
20
20
|
<div class="slides">
|
21
|
-
<section data-markdown="simple.md" data-separator="^\n\n\n" data-separator-vertical="^\n\n"></section>
|
21
|
+
<section data-markdown="simple.md" data-separator="^\r?\n\r?\n\r?\n" data-separator-vertical="^\r?\n\r?\n"></section>
|
22
22
|
</div>
|
23
23
|
|
24
24
|
</div>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<script src="../plugin/highlight/highlight.js"></script>
|
29
29
|
<script src="../plugin/markdown/marked.js"></script>
|
30
30
|
<script src="../plugin/markdown/markdown.js"></script>
|
31
|
-
<script src="qunit-
|
31
|
+
<script src="qunit-2.5.0.js"></script>
|
32
32
|
|
33
33
|
<script src="test-markdown-external.js"></script>
|
34
34
|
|
@@ -1,24 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
Reveal.addEventListener( 'ready', function() {
|
4
2
|
|
5
3
|
QUnit.module( 'Markdown' );
|
6
4
|
|
7
|
-
test( 'Vertical separator', function() {
|
8
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
|
5
|
+
QUnit.test( 'Vertical separator', function( assert ) {
|
6
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
|
9
7
|
});
|
10
8
|
|
11
|
-
test( 'Horizontal separator', function() {
|
12
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section' ).length, 2, 'found two slides' );
|
9
|
+
QUnit.test( 'Horizontal separator', function( assert ) {
|
10
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section' ).length, 2, 'found two slides' );
|
13
11
|
});
|
14
12
|
|
15
|
-
test( 'Language highlighter', function() {
|
16
|
-
strictEqual( document.querySelectorAll( '.hljs-keyword' ).length, 1, 'got rendered highlight tag.' );
|
17
|
-
strictEqual( document.querySelector( '.hljs-keyword' ).innerHTML, 'var', 'the same keyword: var.' );
|
13
|
+
QUnit.test( 'Language highlighter', function( assert ) {
|
14
|
+
assert.strictEqual( document.querySelectorAll( '.hljs-keyword' ).length, 1, 'got rendered highlight tag.' );
|
15
|
+
assert.strictEqual( document.querySelector( '.hljs-keyword' ).innerHTML, 'var', 'the same keyword: var.' );
|
18
16
|
});
|
19
17
|
|
20
|
-
|
21
18
|
} );
|
22
19
|
|
23
20
|
Reveal.initialize();
|
24
|
-
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>reveal.js - Test Markdown Options</title>
|
8
8
|
|
9
9
|
<link rel="stylesheet" href="../css/reveal.css">
|
10
|
-
<link rel="stylesheet" href="qunit-
|
10
|
+
<link rel="stylesheet" href="qunit-2.5.0.css">
|
11
11
|
</head>
|
12
12
|
|
13
13
|
<body style="overflow: auto;">
|
@@ -33,7 +33,7 @@
|
|
33
33
|
|
34
34
|
<script src="../lib/js/head.min.js"></script>
|
35
35
|
<script src="../js/reveal.js"></script>
|
36
|
-
<script src="qunit-
|
36
|
+
<script src="qunit-2.5.0.js"></script>
|
37
37
|
|
38
38
|
<script src="test-markdown-options.js"></script>
|
39
39
|
|
@@ -2,15 +2,15 @@ Reveal.addEventListener( 'ready', function() {
|
|
2
2
|
|
3
3
|
QUnit.module( 'Markdown' );
|
4
4
|
|
5
|
-
test( 'Options are set', function() {
|
6
|
-
strictEqual( marked.defaults.smartypants, true );
|
5
|
+
QUnit.test( 'Options are set', function( assert ) {
|
6
|
+
assert.strictEqual( marked.defaults.smartypants, true );
|
7
7
|
});
|
8
8
|
|
9
|
-
test( 'Smart quotes are activated', function() {
|
9
|
+
QUnit.test( 'Smart quotes are activated', function( assert ) {
|
10
10
|
var text = document.querySelector( '.reveal .slides>section>p' ).textContent;
|
11
11
|
|
12
|
-
strictEqual( /['"]/.test( text ), false );
|
13
|
-
strictEqual( /[“”‘’]/.test( text ), true );
|
12
|
+
assert.strictEqual( /['"]/.test( text ), false );
|
13
|
+
assert.strictEqual( /[“”‘’]/.test( text ), true );
|
14
14
|
});
|
15
15
|
|
16
16
|
} );
|
@@ -18,7 +18,8 @@ Reveal.addEventListener( 'ready', function() {
|
|
18
18
|
Reveal.initialize({
|
19
19
|
dependencies: [
|
20
20
|
{ src: '../plugin/markdown/marked.js' },
|
21
|
-
|
21
|
+
// Test loading JS files with query strings
|
22
|
+
{ src: '../plugin/markdown/markdown.js?query=string' },
|
22
23
|
],
|
23
24
|
markdown: {
|
24
25
|
smartypants: true
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>reveal.js - Test Markdown Attributes</title>
|
8
8
|
|
9
9
|
<link rel="stylesheet" href="../css/reveal.css">
|
10
|
-
<link rel="stylesheet" href="qunit-
|
10
|
+
<link rel="stylesheet" href="qunit-2.5.0.css">
|
11
11
|
</head>
|
12
12
|
|
13
13
|
<body style="overflow: auto;">
|
@@ -120,7 +120,7 @@
|
|
120
120
|
<script src="../js/reveal.js"></script>
|
121
121
|
<script src="../plugin/markdown/marked.js"></script>
|
122
122
|
<script src="../plugin/markdown/markdown.js"></script>
|
123
|
-
<script src="qunit-
|
123
|
+
<script src="qunit-2.5.0.js"></script>
|
124
124
|
|
125
125
|
<script src="test-markdown-slide-attributes.js"></script>
|
126
126
|
|
@@ -1,47 +1,44 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
Reveal.addEventListener( 'ready', function() {
|
4
2
|
|
5
3
|
QUnit.module( 'Markdown' );
|
6
4
|
|
7
|
-
test( 'Vertical separator', function() {
|
8
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' );
|
5
|
+
QUnit.test( 'Vertical separator', function( assert ) {
|
6
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' );
|
9
7
|
});
|
10
8
|
|
11
|
-
test( 'Id on slide', function() {
|
12
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' );
|
13
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' );
|
9
|
+
QUnit.test( 'Id on slide', function( assert ) {
|
10
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' );
|
11
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' );
|
14
12
|
});
|
15
13
|
|
16
|
-
test( 'data-background attributes', function() {
|
17
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
|
18
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
|
19
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
|
14
|
+
QUnit.test( 'data-background attributes', function( assert ) {
|
15
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
|
16
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
|
17
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
|
20
18
|
});
|
21
19
|
|
22
|
-
test( 'data-transition attributes', function() {
|
23
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
|
24
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
|
25
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' );
|
20
|
+
QUnit.test( 'data-transition attributes', function( assert ) {
|
21
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
|
22
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
|
23
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' );
|
26
24
|
});
|
27
25
|
|
28
|
-
test( 'data-background attributes with default separator', function() {
|
29
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
|
30
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
|
31
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
|
26
|
+
QUnit.test( 'data-background attributes with default separator', function( assert ) {
|
27
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
|
28
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
|
29
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
|
32
30
|
});
|
33
31
|
|
34
|
-
test( 'data-transition attributes with default separator', function() {
|
35
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
|
36
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
|
37
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' );
|
32
|
+
QUnit.test( 'data-transition attributes with default separator', function( assert ) {
|
33
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
|
34
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
|
35
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' );
|
38
36
|
});
|
39
37
|
|
40
|
-
test( 'data-transition attributes with inline content', function() {
|
41
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' );
|
38
|
+
QUnit.test( 'data-transition attributes with inline content', function( assert ) {
|
39
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' );
|
42
40
|
});
|
43
41
|
|
44
42
|
} );
|
45
43
|
|
46
44
|
Reveal.initialize();
|
47
|
-
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>reveal.js - Test Markdown</title>
|
8
8
|
|
9
9
|
<link rel="stylesheet" href="../css/reveal.css">
|
10
|
-
<link rel="stylesheet" href="qunit-
|
10
|
+
<link rel="stylesheet" href="qunit-2.5.0.css">
|
11
11
|
</head>
|
12
12
|
|
13
13
|
<body style="overflow: auto;">
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<script src="../js/reveal.js"></script>
|
45
45
|
<script src="../plugin/markdown/marked.js"></script>
|
46
46
|
<script src="../plugin/markdown/markdown.js"></script>
|
47
|
-
<script src="qunit-
|
47
|
+
<script src="qunit-2.5.0.js"></script>
|
48
48
|
|
49
49
|
<script src="test-markdown.js"></script>
|
50
50
|
|
@@ -1,15 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
Reveal.addEventListener( 'ready', function() {
|
4
2
|
|
5
3
|
QUnit.module( 'Markdown' );
|
6
4
|
|
7
|
-
test( 'Vertical separator', function() {
|
8
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
|
5
|
+
QUnit.test( 'Vertical separator', function( assert ) {
|
6
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' );
|
9
7
|
});
|
10
8
|
|
11
|
-
|
12
9
|
} );
|
13
10
|
|
14
11
|
Reveal.initialize();
|
15
|
-
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<link rel="stylesheet" href="../css/reveal.css">
|
10
10
|
<link rel="stylesheet" href="../css/print/pdf.css">
|
11
|
-
<link rel="stylesheet" href="qunit-
|
11
|
+
<link rel="stylesheet" href="qunit-2.5.0.css">
|
12
12
|
</head>
|
13
13
|
|
14
14
|
<body style="overflow: auto;">
|
@@ -75,7 +75,7 @@
|
|
75
75
|
|
76
76
|
<script src="../lib/js/head.min.js"></script>
|
77
77
|
<script src="../js/reveal.js"></script>
|
78
|
-
<script src="qunit-
|
78
|
+
<script src="qunit-2.5.0.js"></script>
|
79
79
|
|
80
80
|
<script src="test-pdf.js"></script>
|
81
81
|
|
@@ -1,15 +1,12 @@
|
|
1
|
-
|
2
1
|
Reveal.addEventListener( 'ready', function() {
|
3
2
|
|
4
3
|
// Only one test for now, we're mainly ensuring that there
|
5
4
|
// are no execution errors when running PDF mode
|
6
5
|
|
7
|
-
test( 'Reveal.isReady', function() {
|
8
|
-
strictEqual( Reveal.isReady(), true, 'returns true' );
|
6
|
+
QUnit.test( 'Reveal.isReady', function( assert ) {
|
7
|
+
assert.strictEqual( Reveal.isReady(), true, 'returns true' );
|
9
8
|
});
|
10
9
|
|
11
|
-
|
12
10
|
} );
|
13
11
|
|
14
12
|
Reveal.initialize({ pdf: true });
|
15
|
-
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>reveal.js - Tests</title>
|
8
8
|
|
9
9
|
<link rel="stylesheet" href="../css/reveal.css">
|
10
|
-
<link rel="stylesheet" href="qunit-
|
10
|
+
<link rel="stylesheet" href="qunit-2.5.0.css">
|
11
11
|
</head>
|
12
12
|
|
13
13
|
<body style="overflow: auto;">
|
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
<script src="../lib/js/head.min.js"></script>
|
80
80
|
<script src="../js/reveal.js"></script>
|
81
|
-
<script src="qunit-
|
81
|
+
<script src="qunit-2.5.0.js"></script>
|
82
82
|
|
83
83
|
<script src="test.js"></script>
|
84
84
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
// These tests expect the DOM to contain a presentation
|
3
2
|
// with the following slide structure:
|
4
3
|
//
|
@@ -8,7 +7,6 @@
|
|
8
7
|
// 3 - Two fragments with same data-fragment-index
|
9
8
|
// 4
|
10
9
|
|
11
|
-
|
12
10
|
Reveal.addEventListener( 'ready', function() {
|
13
11
|
|
14
12
|
// ---------------------------------------------------------------
|
@@ -16,16 +14,16 @@ Reveal.addEventListener( 'ready', function() {
|
|
16
14
|
|
17
15
|
QUnit.module( 'DOM' );
|
18
16
|
|
19
|
-
test( 'Initial slides classes', function() {
|
17
|
+
QUnit.test( 'Initial slides classes', function( assert ) {
|
20
18
|
var horizontalSlides = document.querySelectorAll( '.reveal .slides>section' )
|
21
19
|
|
22
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section.past' ).length, 0, 'no .past slides' );
|
23
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section.present' ).length, 1, 'one .present slide' );
|
24
|
-
strictEqual( document.querySelectorAll( '.reveal .slides>section.future' ).length, horizontalSlides.length - 1, 'remaining horizontal slides are .future' );
|
20
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section.past' ).length, 0, 'no .past slides' );
|
21
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section.present' ).length, 1, 'one .present slide' );
|
22
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides>section.future' ).length, horizontalSlides.length - 1, 'remaining horizontal slides are .future' );
|
25
23
|
|
26
|
-
strictEqual( document.querySelectorAll( '.reveal .slides section.stack' ).length, 2, 'two .stacks' );
|
24
|
+
assert.strictEqual( document.querySelectorAll( '.reveal .slides section.stack' ).length, 2, 'two .stacks' );
|
27
25
|
|
28
|
-
ok( document.querySelectorAll( '.reveal .slides section.stack' )[0].querySelectorAll( '.future' ).length > 0, 'vertical slides are given .future' );
|
26
|
+
assert.ok( document.querySelectorAll( '.reveal .slides section.stack' )[0].querySelectorAll( '.future' ).length > 0, 'vertical slides are given .future' );
|
29
27
|
});
|
30
28
|
|
31
29
|
// ---------------------------------------------------------------
|
@@ -33,203 +31,203 @@ Reveal.addEventListener( 'ready', function() {
|
|
33
31
|
|
34
32
|
QUnit.module( 'API' );
|
35
33
|
|
36
|
-
test( 'Reveal.isReady', function() {
|
37
|
-
strictEqual( Reveal.isReady(), true, 'returns true' );
|
34
|
+
QUnit.test( 'Reveal.isReady', function( assert ) {
|
35
|
+
assert.strictEqual( Reveal.isReady(), true, 'returns true' );
|
38
36
|
});
|
39
37
|
|
40
|
-
test( 'Reveal.isOverview', function() {
|
41
|
-
strictEqual( Reveal.isOverview(), false, 'false by default' );
|
38
|
+
QUnit.test( 'Reveal.isOverview', function( assert ) {
|
39
|
+
assert.strictEqual( Reveal.isOverview(), false, 'false by default' );
|
42
40
|
|
43
41
|
Reveal.toggleOverview();
|
44
|
-
strictEqual( Reveal.isOverview(), true, 'true after toggling on' );
|
42
|
+
assert.strictEqual( Reveal.isOverview(), true, 'true after toggling on' );
|
45
43
|
|
46
44
|
Reveal.toggleOverview();
|
47
|
-
strictEqual( Reveal.isOverview(), false, 'false after toggling off' );
|
45
|
+
assert.strictEqual( Reveal.isOverview(), false, 'false after toggling off' );
|
48
46
|
});
|
49
47
|
|
50
|
-
test( 'Reveal.isPaused', function() {
|
51
|
-
strictEqual( Reveal.isPaused(), false, 'false by default' );
|
48
|
+
QUnit.test( 'Reveal.isPaused', function( assert ) {
|
49
|
+
assert.strictEqual( Reveal.isPaused(), false, 'false by default' );
|
52
50
|
|
53
51
|
Reveal.togglePause();
|
54
|
-
strictEqual( Reveal.isPaused(), true, 'true after pausing' );
|
52
|
+
assert.strictEqual( Reveal.isPaused(), true, 'true after pausing' );
|
55
53
|
|
56
54
|
Reveal.togglePause();
|
57
|
-
strictEqual( Reveal.isPaused(), false, 'false after resuming' );
|
55
|
+
assert.strictEqual( Reveal.isPaused(), false, 'false after resuming' );
|
58
56
|
});
|
59
57
|
|
60
|
-
test( 'Reveal.isFirstSlide', function() {
|
58
|
+
QUnit.test( 'Reveal.isFirstSlide', function( assert ) {
|
61
59
|
Reveal.slide( 0, 0 );
|
62
|
-
strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
|
60
|
+
assert.strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
|
63
61
|
|
64
62
|
Reveal.slide( 1, 0 );
|
65
|
-
strictEqual( Reveal.isFirstSlide(), false, 'false after Reveal.slide( 1, 0 )' );
|
63
|
+
assert.strictEqual( Reveal.isFirstSlide(), false, 'false after Reveal.slide( 1, 0 )' );
|
66
64
|
|
67
65
|
Reveal.slide( 0, 0 );
|
68
|
-
strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
|
66
|
+
assert.strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 0, 0 )' );
|
69
67
|
});
|
70
68
|
|
71
|
-
test( 'Reveal.isFirstSlide after vertical slide', function() {
|
69
|
+
QUnit.test( 'Reveal.isFirstSlide after vertical slide', function( assert ) {
|
72
70
|
Reveal.slide( 1, 1 );
|
73
71
|
Reveal.slide( 0, 0 );
|
74
|
-
strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( 0, 0 )' );
|
72
|
+
assert.strictEqual( Reveal.isFirstSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( 0, 0 )' );
|
75
73
|
});
|
76
74
|
|
77
|
-
test( 'Reveal.isLastSlide', function() {
|
75
|
+
QUnit.test( 'Reveal.isLastSlide', function( assert ) {
|
78
76
|
Reveal.slide( 0, 0 );
|
79
|
-
strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
|
77
|
+
assert.strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
|
80
78
|
|
81
79
|
var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
|
82
80
|
|
83
81
|
Reveal.slide( lastSlideIndex, 0 );
|
84
|
-
strictEqual( Reveal.isLastSlide(), true, 'true after Reveal.slide( '+ lastSlideIndex +', 0 )' );
|
82
|
+
assert.strictEqual( Reveal.isLastSlide(), true, 'true after Reveal.slide( '+ lastSlideIndex +', 0 )' );
|
85
83
|
|
86
84
|
Reveal.slide( 0, 0 );
|
87
|
-
strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
|
85
|
+
assert.strictEqual( Reveal.isLastSlide(), false, 'false after Reveal.slide( 0, 0 )' );
|
88
86
|
});
|
89
87
|
|
90
|
-
test( 'Reveal.isLastSlide after vertical slide', function() {
|
88
|
+
QUnit.test( 'Reveal.isLastSlide after vertical slide', function( assert ) {
|
91
89
|
var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
|
92
90
|
|
93
91
|
Reveal.slide( 1, 1 );
|
94
92
|
Reveal.slide( lastSlideIndex );
|
95
|
-
strictEqual( Reveal.isLastSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( '+ lastSlideIndex +', 0 )' );
|
93
|
+
assert.strictEqual( Reveal.isLastSlide(), true, 'true after Reveal.slide( 1, 1 ) and then Reveal.slide( '+ lastSlideIndex +', 0 )' );
|
96
94
|
});
|
97
95
|
|
98
|
-
test( 'Reveal.getTotalSlides', function() {
|
99
|
-
strictEqual( Reveal.getTotalSlides(), 8, 'eight slides in total' );
|
96
|
+
QUnit.test( 'Reveal.getTotalSlides', function( assert ) {
|
97
|
+
assert.strictEqual( Reveal.getTotalSlides(), 8, 'eight slides in total' );
|
100
98
|
});
|
101
99
|
|
102
|
-
test( 'Reveal.getIndices', function() {
|
100
|
+
QUnit.test( 'Reveal.getIndices', function( assert ) {
|
103
101
|
var indices = Reveal.getIndices();
|
104
102
|
|
105
|
-
ok( indices.hasOwnProperty( 'h' ), 'h exists' );
|
106
|
-
ok( indices.hasOwnProperty( 'v' ), 'v exists' );
|
107
|
-
ok( indices.hasOwnProperty( 'f' ), 'f exists' );
|
103
|
+
assert.ok( indices.hasOwnProperty( 'h' ), 'h exists' );
|
104
|
+
assert.ok( indices.hasOwnProperty( 'v' ), 'v exists' );
|
105
|
+
assert.ok( indices.hasOwnProperty( 'f' ), 'f exists' );
|
108
106
|
|
109
107
|
Reveal.slide( 1, 0 );
|
110
|
-
strictEqual( Reveal.getIndices().h, 1, 'h 1' );
|
111
|
-
strictEqual( Reveal.getIndices().v, 0, 'v 0' );
|
108
|
+
assert.strictEqual( Reveal.getIndices().h, 1, 'h 1' );
|
109
|
+
assert.strictEqual( Reveal.getIndices().v, 0, 'v 0' );
|
112
110
|
|
113
111
|
Reveal.slide( 1, 2 );
|
114
|
-
strictEqual( Reveal.getIndices().h, 1, 'h 1' );
|
115
|
-
strictEqual( Reveal.getIndices().v, 2, 'v 2' );
|
112
|
+
assert.strictEqual( Reveal.getIndices().h, 1, 'h 1' );
|
113
|
+
assert.strictEqual( Reveal.getIndices().v, 2, 'v 2' );
|
116
114
|
|
117
115
|
Reveal.slide( 0, 0 );
|
118
|
-
strictEqual( Reveal.getIndices().h, 0, 'h 0' );
|
119
|
-
strictEqual( Reveal.getIndices().v, 0, 'v 0' );
|
116
|
+
assert.strictEqual( Reveal.getIndices().h, 0, 'h 0' );
|
117
|
+
assert.strictEqual( Reveal.getIndices().v, 0, 'v 0' );
|
120
118
|
});
|
121
119
|
|
122
|
-
test( 'Reveal.getSlide', function() {
|
123
|
-
equal( Reveal.getSlide( 0 ), document.querySelector( '.reveal .slides>section:first-child' ), 'gets correct first slide' );
|
124
|
-
equal( Reveal.getSlide( 1 ), document.querySelector( '.reveal .slides>section:nth-child(2)' ), 'no v index returns stack' );
|
125
|
-
equal( Reveal.getSlide( 1, 0 ), document.querySelector( '.reveal .slides>section:nth-child(2)>section:nth-child(1)' ), 'v index 0 returns first vertical child' );
|
126
|
-
equal( Reveal.getSlide( 1, 1 ), document.querySelector( '.reveal .slides>section:nth-child(2)>section:nth-child(2)' ), 'v index 1 returns second vertical child' );
|
120
|
+
QUnit.test( 'Reveal.getSlide', function( assert ) {
|
121
|
+
assert.equal( Reveal.getSlide( 0 ), document.querySelector( '.reveal .slides>section:first-child' ), 'gets correct first slide' );
|
122
|
+
assert.equal( Reveal.getSlide( 1 ), document.querySelector( '.reveal .slides>section:nth-child(2)' ), 'no v index returns stack' );
|
123
|
+
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' );
|
124
|
+
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' );
|
127
125
|
|
128
|
-
strictEqual( Reveal.getSlide( 100 ), undefined, 'undefined when out of horizontal bounds' );
|
129
|
-
strictEqual( Reveal.getSlide( 1, 100 ), undefined, 'undefined when out of vertical bounds' );
|
126
|
+
assert.strictEqual( Reveal.getSlide( 100 ), undefined, 'undefined when out of horizontal bounds' );
|
127
|
+
assert.strictEqual( Reveal.getSlide( 1, 100 ), undefined, 'undefined when out of vertical bounds' );
|
130
128
|
});
|
131
129
|
|
132
|
-
test( 'Reveal.getSlideBackground', function() {
|
133
|
-
equal( Reveal.getSlideBackground( 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:first-child' ), 'gets correct first background' );
|
134
|
-
equal( Reveal.getSlideBackground( 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2)' ), 'no v index returns stack' );
|
135
|
-
equal( Reveal.getSlideBackground( 1, 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(
|
136
|
-
equal( Reveal.getSlideBackground( 1, 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2) .slide-background:nth-child(
|
130
|
+
QUnit.test( 'Reveal.getSlideBackground', function( assert ) {
|
131
|
+
assert.equal( Reveal.getSlideBackground( 0 ), document.querySelector( '.reveal .backgrounds>.slide-background:first-child' ), 'gets correct first background' );
|
132
|
+
assert.equal( Reveal.getSlideBackground( 1 ), document.querySelector( '.reveal .backgrounds>.slide-background:nth-child(2)' ), 'no v index returns stack' );
|
133
|
+
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' );
|
134
|
+
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' );
|
137
135
|
|
138
|
-
strictEqual( Reveal.getSlideBackground( 100 ), undefined, 'undefined when out of horizontal bounds' );
|
139
|
-
strictEqual( Reveal.getSlideBackground( 1, 100 ), undefined, 'undefined when out of vertical bounds' );
|
136
|
+
assert.strictEqual( Reveal.getSlideBackground( 100 ), undefined, 'undefined when out of horizontal bounds' );
|
137
|
+
assert.strictEqual( Reveal.getSlideBackground( 1, 100 ), undefined, 'undefined when out of vertical bounds' );
|
140
138
|
});
|
141
139
|
|
142
|
-
test( 'Reveal.getSlideNotes', function() {
|
140
|
+
QUnit.test( 'Reveal.getSlideNotes', function( assert ) {
|
143
141
|
Reveal.slide( 0, 0 );
|
144
|
-
ok( Reveal.getSlideNotes() === 'speaker notes 1', 'works with <aside class="notes">' );
|
142
|
+
assert.ok( Reveal.getSlideNotes() === 'speaker notes 1', 'works with <aside class="notes">' );
|
145
143
|
|
146
144
|
Reveal.slide( 1, 0 );
|
147
|
-
ok( Reveal.getSlideNotes() === 'speaker notes 2', 'works with <section data-notes="">' );
|
145
|
+
assert.ok( Reveal.getSlideNotes() === 'speaker notes 2', 'works with <section data-notes="">' );
|
148
146
|
});
|
149
147
|
|
150
|
-
test( 'Reveal.getPreviousSlide/getCurrentSlide', function() {
|
148
|
+
QUnit.test( 'Reveal.getPreviousSlide/getCurrentSlide', function( assert ) {
|
151
149
|
Reveal.slide( 0, 0 );
|
152
150
|
Reveal.slide( 1, 0 );
|
153
151
|
|
154
152
|
var firstSlide = document.querySelector( '.reveal .slides>section:first-child' );
|
155
153
|
var secondSlide = document.querySelector( '.reveal .slides>section:nth-child(2)>section' );
|
156
154
|
|
157
|
-
equal( Reveal.getPreviousSlide(), firstSlide, 'previous is slide #0' );
|
158
|
-
equal( Reveal.getCurrentSlide(), secondSlide, 'current is slide #1' );
|
155
|
+
assert.equal( Reveal.getPreviousSlide(), firstSlide, 'previous is slide #0' );
|
156
|
+
assert.equal( Reveal.getCurrentSlide(), secondSlide, 'current is slide #1' );
|
159
157
|
});
|
160
158
|
|
161
|
-
test( 'Reveal.getProgress', function() {
|
159
|
+
QUnit.test( 'Reveal.getProgress', function( assert ) {
|
162
160
|
Reveal.slide( 0, 0 );
|
163
|
-
strictEqual( Reveal.getProgress(), 0, 'progress is 0 on first slide' );
|
161
|
+
assert.strictEqual( Reveal.getProgress(), 0, 'progress is 0 on first slide' );
|
164
162
|
|
165
163
|
var lastSlideIndex = document.querySelectorAll( '.reveal .slides>section' ).length - 1;
|
166
164
|
|
167
165
|
Reveal.slide( lastSlideIndex, 0 );
|
168
|
-
strictEqual( Reveal.getProgress(), 1, 'progress is 1 on last slide' );
|
166
|
+
assert.strictEqual( Reveal.getProgress(), 1, 'progress is 1 on last slide' );
|
169
167
|
});
|
170
168
|
|
171
|
-
test( 'Reveal.getScale', function() {
|
172
|
-
ok( typeof Reveal.getScale() === 'number', 'has scale' );
|
169
|
+
QUnit.test( 'Reveal.getScale', function( assert ) {
|
170
|
+
assert.ok( typeof Reveal.getScale() === 'number', 'has scale' );
|
173
171
|
});
|
174
172
|
|
175
|
-
test( 'Reveal.getConfig', function() {
|
176
|
-
ok( typeof Reveal.getConfig() === 'object', 'has config' );
|
173
|
+
QUnit.test( 'Reveal.getConfig', function( assert ) {
|
174
|
+
assert.ok( typeof Reveal.getConfig() === 'object', 'has config' );
|
177
175
|
});
|
178
176
|
|
179
|
-
test( 'Reveal.configure', function() {
|
180
|
-
strictEqual( Reveal.getConfig().loop, false, '"loop" is false to start with' );
|
177
|
+
QUnit.test( 'Reveal.configure', function( assert ) {
|
178
|
+
assert.strictEqual( Reveal.getConfig().loop, false, '"loop" is false to start with' );
|
181
179
|
|
182
180
|
Reveal.configure({ loop: true });
|
183
|
-
strictEqual( Reveal.getConfig().loop, true, '"loop" has changed to true' );
|
181
|
+
assert.strictEqual( Reveal.getConfig().loop, true, '"loop" has changed to true' );
|
184
182
|
|
185
183
|
Reveal.configure({ loop: false, customTestValue: 1 });
|
186
|
-
strictEqual( Reveal.getConfig().customTestValue, 1, 'supports custom values' );
|
184
|
+
assert.strictEqual( Reveal.getConfig().customTestValue, 1, 'supports custom values' );
|
187
185
|
});
|
188
186
|
|
189
|
-
test( 'Reveal.availableRoutes', function() {
|
187
|
+
QUnit.test( 'Reveal.availableRoutes', function( assert ) {
|
190
188
|
Reveal.slide( 0, 0 );
|
191
|
-
deepEqual( Reveal.availableRoutes(), { left: false, up: false, down: false, right: true }, 'correct for first slide' );
|
189
|
+
assert.deepEqual( Reveal.availableRoutes(), { left: false, up: false, down: false, right: true }, 'correct for first slide' );
|
192
190
|
|
193
191
|
Reveal.slide( 1, 0 );
|
194
|
-
deepEqual( Reveal.availableRoutes(), { left: true, up: false, down: true, right: true }, 'correct for vertical slide' );
|
192
|
+
assert.deepEqual( Reveal.availableRoutes(), { left: true, up: false, down: true, right: true }, 'correct for vertical slide' );
|
195
193
|
});
|
196
194
|
|
197
|
-
test( 'Reveal.next', function() {
|
195
|
+
QUnit.test( 'Reveal.next', function( assert ) {
|
198
196
|
Reveal.slide( 0, 0 );
|
199
197
|
|
200
198
|
// Step through vertical child slides
|
201
199
|
Reveal.next();
|
202
|
-
deepEqual( Reveal.getIndices(), { h: 1, v: 0, f: undefined } );
|
200
|
+
assert.deepEqual( Reveal.getIndices(), { h: 1, v: 0, f: undefined } );
|
203
201
|
|
204
202
|
Reveal.next();
|
205
|
-
deepEqual( Reveal.getIndices(), { h: 1, v: 1, f: undefined } );
|
203
|
+
assert.deepEqual( Reveal.getIndices(), { h: 1, v: 1, f: undefined } );
|
206
204
|
|
207
205
|
Reveal.next();
|
208
|
-
deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined } );
|
206
|
+
assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined } );
|
209
207
|
|
210
208
|
// Step through fragments
|
211
209
|
Reveal.next();
|
212
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 } );
|
210
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 } );
|
213
211
|
|
214
212
|
Reveal.next();
|
215
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 } );
|
213
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 } );
|
216
214
|
|
217
215
|
Reveal.next();
|
218
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 } );
|
216
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 } );
|
219
217
|
|
220
218
|
Reveal.next();
|
221
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 } );
|
219
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 } );
|
222
220
|
});
|
223
221
|
|
224
|
-
test( 'Reveal.next at end', function() {
|
222
|
+
QUnit.test( 'Reveal.next at end', function( assert ) {
|
225
223
|
Reveal.slide( 3 );
|
226
224
|
|
227
225
|
// We're at the end, this should have no effect
|
228
226
|
Reveal.next();
|
229
|
-
deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
|
227
|
+
assert.deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
|
230
228
|
|
231
229
|
Reveal.next();
|
232
|
-
deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
|
230
|
+
assert.deepEqual( Reveal.getIndices(), { h: 3, v: 0, f: undefined } );
|
233
231
|
});
|
234
232
|
|
235
233
|
|
@@ -238,121 +236,123 @@ Reveal.addEventListener( 'ready', function() {
|
|
238
236
|
|
239
237
|
QUnit.module( 'Fragments' );
|
240
238
|
|
241
|
-
test( 'Sliding to fragments', function() {
|
239
|
+
QUnit.test( 'Sliding to fragments', function( assert ) {
|
242
240
|
Reveal.slide( 2, 0, -1 );
|
243
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 }, 'Reveal.slide( 2, 0, -1 )' );
|
241
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: -1 }, 'Reveal.slide( 2, 0, -1 )' );
|
244
242
|
|
245
243
|
Reveal.slide( 2, 0, 0 );
|
246
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'Reveal.slide( 2, 0, 0 )' );
|
244
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'Reveal.slide( 2, 0, 0 )' );
|
247
245
|
|
248
246
|
Reveal.slide( 2, 0, 2 );
|
249
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'Reveal.slide( 2, 0, 2 )' );
|
247
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'Reveal.slide( 2, 0, 2 )' );
|
250
248
|
|
251
249
|
Reveal.slide( 2, 0, 1 );
|
252
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'Reveal.slide( 2, 0, 1 )' );
|
250
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'Reveal.slide( 2, 0, 1 )' );
|
253
251
|
});
|
254
252
|
|
255
|
-
test( 'Hiding all fragments', function() {
|
253
|
+
QUnit.test( 'Hiding all fragments', function( assert ) {
|
256
254
|
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
257
255
|
|
258
256
|
Reveal.slide( 2, 0, 0 );
|
259
|
-
strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 1, 'one fragment visible when index is 0' );
|
257
|
+
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 1, 'one fragment visible when index is 0' );
|
260
258
|
|
261
259
|
Reveal.slide( 2, 0, -1 );
|
262
|
-
strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when index is -1' );
|
260
|
+
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when index is -1' );
|
263
261
|
});
|
264
262
|
|
265
|
-
test( 'Current fragment', function() {
|
263
|
+
QUnit.test( 'Current fragment', function( assert ) {
|
266
264
|
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
267
265
|
|
268
266
|
Reveal.slide( 2, 0 );
|
269
|
-
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment at index -1' );
|
267
|
+
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment at index -1' );
|
270
268
|
|
271
269
|
Reveal.slide( 2, 0, 0 );
|
272
|
-
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 1, 'one current fragment at index 0' );
|
270
|
+
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 1, 'one current fragment at index 0' );
|
273
271
|
|
274
272
|
Reveal.slide( 1, 0, 0 );
|
275
|
-
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to previous slide' );
|
273
|
+
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to previous slide' );
|
276
274
|
|
277
275
|
Reveal.slide( 3, 0, 0 );
|
278
|
-
strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to next slide' );
|
276
|
+
assert.strictEqual( fragmentSlide.querySelectorAll( '.fragment.current-fragment' ).length, 0, 'no current fragment when navigating to next slide' );
|
279
277
|
});
|
280
278
|
|
281
|
-
test( 'Stepping through fragments', function() {
|
279
|
+
QUnit.test( 'Stepping through fragments', function( assert ) {
|
282
280
|
Reveal.slide( 2, 0, -1 );
|
283
281
|
|
284
282
|
// forwards:
|
285
283
|
|
286
284
|
Reveal.next();
|
287
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'next() goes to next fragment' );
|
285
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'next() goes to next fragment' );
|
288
286
|
|
289
287
|
Reveal.right();
|
290
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'right() goes to next fragment' );
|
288
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'right() goes to next fragment' );
|
291
289
|
|
292
290
|
Reveal.down();
|
293
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'down() goes to next fragment' );
|
291
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'down() goes to next fragment' );
|
294
292
|
|
295
293
|
Reveal.down(); // moves to f #3
|
296
294
|
|
297
295
|
// backwards:
|
298
296
|
|
299
297
|
Reveal.prev();
|
300
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'prev() goes to prev fragment' );
|
298
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 2 }, 'prev() goes to prev fragment' );
|
301
299
|
|
302
300
|
Reveal.left();
|
303
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'left() goes to prev fragment' );
|
301
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'left() goes to prev fragment' );
|
304
302
|
|
305
303
|
Reveal.up();
|
306
|
-
deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'up() goes to prev fragment' );
|
304
|
+
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 0 }, 'up() goes to prev fragment' );
|
307
305
|
});
|
308
306
|
|
309
|
-
test( 'Stepping past fragments', function() {
|
307
|
+
QUnit.test( 'Stepping past fragments', function( assert ) {
|
310
308
|
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
311
309
|
|
312
310
|
Reveal.slide( 0, 0, 0 );
|
313
|
-
equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when on previous slide' );
|
311
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 0, 'no fragments visible when on previous slide' );
|
314
312
|
|
315
313
|
Reveal.slide( 3, 0, 0 );
|
316
|
-
equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 3, 'all fragments visible when on future slide' );
|
314
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 3, 'all fragments visible when on future slide' );
|
317
315
|
});
|
318
316
|
|
319
|
-
test( 'Fragment indices', function() {
|
317
|
+
QUnit.test( 'Fragment indices', function( assert ) {
|
320
318
|
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(2)' );
|
321
319
|
|
322
320
|
Reveal.slide( 3, 0, 0 );
|
323
|
-
equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 2, 'both fragments of same index are shown' );
|
321
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment.visible' ).length, 2, 'both fragments of same index are shown' );
|
324
322
|
|
325
323
|
// This slide has three fragments, first one is index 0, second and third have index 1
|
326
324
|
Reveal.slide( 2, 2, 0 );
|
327
|
-
equal( Reveal.getIndices().f, 0, 'returns correct index for first fragment' );
|
325
|
+
assert.equal( Reveal.getIndices().f, 0, 'returns correct index for first fragment' );
|
328
326
|
|
329
327
|
Reveal.slide( 2, 2, 1 );
|
330
|
-
equal( Reveal.getIndices().f, 1, 'returns correct index for two fragments with same index' );
|
328
|
+
assert.equal( Reveal.getIndices().f, 1, 'returns correct index for two fragments with same index' );
|
331
329
|
});
|
332
330
|
|
333
|
-
test( 'Index generation', function() {
|
331
|
+
QUnit.test( 'Index generation', function( assert ) {
|
334
332
|
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
335
333
|
|
336
334
|
// These have no indices defined to start with
|
337
|
-
equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
|
338
|
-
equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
|
339
|
-
equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '2' );
|
335
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
|
336
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
|
337
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '2' );
|
340
338
|
});
|
341
339
|
|
342
|
-
test( 'Index normalization', function() {
|
340
|
+
QUnit.test( 'Index normalization', function( assert ) {
|
343
341
|
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(3)' );
|
344
342
|
|
345
343
|
// These start out as 1-4-4 and should normalize to 0-1-1
|
346
|
-
equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
|
347
|
-
equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
|
348
|
-
equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '1' );
|
344
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[0].getAttribute( 'data-fragment-index' ), '0' );
|
345
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[1].getAttribute( 'data-fragment-index' ), '1' );
|
346
|
+
assert.equal( fragmentSlide.querySelectorAll( '.fragment' )[2].getAttribute( 'data-fragment-index' ), '1' );
|
349
347
|
});
|
350
348
|
|
351
|
-
|
352
|
-
expect( 2 );
|
349
|
+
QUnit.test( 'fragmentshown event', function( assert ) {
|
350
|
+
assert.expect( 2 );
|
351
|
+
var done = assert.async( 2 );
|
353
352
|
|
354
353
|
var _onEvent = function( event ) {
|
355
|
-
ok( true, 'event fired' );
|
354
|
+
assert.ok( true, 'event fired' );
|
355
|
+
done();
|
356
356
|
}
|
357
357
|
|
358
358
|
Reveal.addEventListener( 'fragmentshown', _onEvent );
|
@@ -364,16 +364,16 @@ Reveal.addEventListener( 'ready', function() {
|
|
364
364
|
Reveal.next();
|
365
365
|
Reveal.prev(); // shouldn't fire fragmentshown
|
366
366
|
|
367
|
-
start();
|
368
|
-
|
369
367
|
Reveal.removeEventListener( 'fragmentshown', _onEvent );
|
370
368
|
});
|
371
369
|
|
372
|
-
|
373
|
-
expect( 2 );
|
370
|
+
QUnit.test( 'fragmenthidden event', function( assert ) {
|
371
|
+
assert.expect( 2 );
|
372
|
+
var done = assert.async( 2 );
|
374
373
|
|
375
374
|
var _onEvent = function( event ) {
|
376
|
-
ok( true, 'event fired' );
|
375
|
+
assert.ok( true, 'event fired' );
|
376
|
+
done();
|
377
377
|
}
|
378
378
|
|
379
379
|
Reveal.addEventListener( 'fragmenthidden', _onEvent );
|
@@ -384,8 +384,6 @@ Reveal.addEventListener( 'ready', function() {
|
|
384
384
|
Reveal.prev();
|
385
385
|
Reveal.next(); // shouldn't fire fragmenthidden
|
386
386
|
|
387
|
-
start();
|
388
|
-
|
389
387
|
Reveal.removeEventListener( 'fragmenthidden', _onEvent );
|
390
388
|
});
|
391
389
|
|
@@ -395,50 +393,52 @@ Reveal.addEventListener( 'ready', function() {
|
|
395
393
|
|
396
394
|
QUnit.module( 'Auto Sliding' );
|
397
395
|
|
398
|
-
test( 'Reveal.isAutoSliding', function() {
|
399
|
-
strictEqual( Reveal.isAutoSliding(), false, 'false by default' );
|
396
|
+
QUnit.test( 'Reveal.isAutoSliding', function( assert ) {
|
397
|
+
assert.strictEqual( Reveal.isAutoSliding(), false, 'false by default' );
|
400
398
|
|
401
399
|
Reveal.configure({ autoSlide: 10000 });
|
402
|
-
strictEqual( Reveal.isAutoSliding(), true, 'true after starting' );
|
400
|
+
assert.strictEqual( Reveal.isAutoSliding(), true, 'true after starting' );
|
403
401
|
|
404
402
|
Reveal.configure({ autoSlide: 0 });
|
405
|
-
strictEqual( Reveal.isAutoSliding(), false, 'false after setting to 0' );
|
403
|
+
assert.strictEqual( Reveal.isAutoSliding(), false, 'false after setting to 0' );
|
406
404
|
});
|
407
405
|
|
408
|
-
test( 'Reveal.toggleAutoSlide', function() {
|
406
|
+
QUnit.test( 'Reveal.toggleAutoSlide', function( assert ) {
|
409
407
|
Reveal.configure({ autoSlide: 10000 });
|
410
408
|
|
411
409
|
Reveal.toggleAutoSlide();
|
412
|
-
strictEqual( Reveal.isAutoSliding(), false, 'false after first toggle' );
|
410
|
+
assert.strictEqual( Reveal.isAutoSliding(), false, 'false after first toggle' );
|
413
411
|
Reveal.toggleAutoSlide();
|
414
|
-
strictEqual( Reveal.isAutoSliding(), true, 'true after second toggle' );
|
412
|
+
assert.strictEqual( Reveal.isAutoSliding(), true, 'true after second toggle' );
|
415
413
|
|
416
414
|
Reveal.configure({ autoSlide: 0 });
|
417
415
|
});
|
418
416
|
|
419
|
-
|
420
|
-
expect( 1 );
|
417
|
+
QUnit.test( 'autoslidepaused', function( assert ) {
|
418
|
+
assert.expect( 1 );
|
419
|
+
var done = assert.async();
|
421
420
|
|
422
421
|
var _onEvent = function( event ) {
|
423
|
-
ok( true, 'event fired' );
|
422
|
+
assert.ok( true, 'event fired' );
|
423
|
+
done();
|
424
424
|
}
|
425
425
|
|
426
426
|
Reveal.addEventListener( 'autoslidepaused', _onEvent );
|
427
427
|
Reveal.configure({ autoSlide: 10000 });
|
428
428
|
Reveal.toggleAutoSlide();
|
429
429
|
|
430
|
-
start();
|
431
|
-
|
432
430
|
// cleanup
|
433
431
|
Reveal.configure({ autoSlide: 0 });
|
434
432
|
Reveal.removeEventListener( 'autoslidepaused', _onEvent );
|
435
433
|
});
|
436
434
|
|
437
|
-
|
438
|
-
expect( 1 );
|
435
|
+
QUnit.test( 'autoslideresumed', function( assert ) {
|
436
|
+
assert.expect( 1 );
|
437
|
+
var done = assert.async();
|
439
438
|
|
440
439
|
var _onEvent = function( event ) {
|
441
|
-
ok( true, 'event fired' );
|
440
|
+
assert.ok( true, 'event fired' );
|
441
|
+
done();
|
442
442
|
}
|
443
443
|
|
444
444
|
Reveal.addEventListener( 'autoslideresumed', _onEvent );
|
@@ -446,8 +446,6 @@ Reveal.addEventListener( 'ready', function() {
|
|
446
446
|
Reveal.toggleAutoSlide();
|
447
447
|
Reveal.toggleAutoSlide();
|
448
448
|
|
449
|
-
start();
|
450
|
-
|
451
449
|
// cleanup
|
452
450
|
Reveal.configure({ autoSlide: 0 });
|
453
451
|
Reveal.removeEventListener( 'autoslideresumed', _onEvent );
|
@@ -459,36 +457,36 @@ Reveal.addEventListener( 'ready', function() {
|
|
459
457
|
|
460
458
|
QUnit.module( 'Configuration' );
|
461
459
|
|
462
|
-
test( 'Controls', function() {
|
460
|
+
QUnit.test( 'Controls', function( assert ) {
|
463
461
|
var controlsElement = document.querySelector( '.reveal>.controls' );
|
464
462
|
|
465
463
|
Reveal.configure({ controls: false });
|
466
|
-
equal( controlsElement.style.display, 'none', 'controls are hidden' );
|
464
|
+
assert.equal( controlsElement.style.display, 'none', 'controls are hidden' );
|
467
465
|
|
468
466
|
Reveal.configure({ controls: true });
|
469
|
-
equal( controlsElement.style.display, 'block', 'controls are visible' );
|
467
|
+
assert.equal( controlsElement.style.display, 'block', 'controls are visible' );
|
470
468
|
});
|
471
469
|
|
472
|
-
test( 'Progress', function() {
|
470
|
+
QUnit.test( 'Progress', function( assert ) {
|
473
471
|
var progressElement = document.querySelector( '.reveal>.progress' );
|
474
472
|
|
475
473
|
Reveal.configure({ progress: false });
|
476
|
-
equal( progressElement.style.display, 'none', 'progress are hidden' );
|
474
|
+
assert.equal( progressElement.style.display, 'none', 'progress are hidden' );
|
477
475
|
|
478
476
|
Reveal.configure({ progress: true });
|
479
|
-
equal( progressElement.style.display, 'block', 'progress are visible' );
|
477
|
+
assert.equal( progressElement.style.display, 'block', 'progress are visible' );
|
480
478
|
});
|
481
479
|
|
482
|
-
test( 'Loop', function() {
|
480
|
+
QUnit.test( 'Loop', function( assert ) {
|
483
481
|
Reveal.configure({ loop: true });
|
484
482
|
|
485
483
|
Reveal.slide( 0, 0 );
|
486
484
|
|
487
485
|
Reveal.left();
|
488
|
-
notEqual( Reveal.getIndices().h, 0, 'looped from start to end' );
|
486
|
+
assert.notEqual( Reveal.getIndices().h, 0, 'looped from start to end' );
|
489
487
|
|
490
488
|
Reveal.right();
|
491
|
-
equal( Reveal.getIndices().h, 0, 'looped from end to start' );
|
489
|
+
assert.equal( Reveal.getIndices().h, 0, 'looped from end to start' );
|
492
490
|
|
493
491
|
Reveal.configure({ loop: false });
|
494
492
|
});
|
@@ -499,34 +497,34 @@ Reveal.addEventListener( 'ready', function() {
|
|
499
497
|
|
500
498
|
QUnit.module( 'Lazy-Loading' );
|
501
499
|
|
502
|
-
test( 'img with data-src', function() {
|
503
|
-
strictEqual( document.querySelectorAll( '.reveal section img[src]' ).length, 1, 'Image source has been set' );
|
500
|
+
QUnit.test( 'img with data-src', function( assert ) {
|
501
|
+
assert.strictEqual( document.querySelectorAll( '.reveal section img[src]' ).length, 1, 'Image source has been set' );
|
504
502
|
});
|
505
503
|
|
506
|
-
test( 'video with data-src', function() {
|
507
|
-
strictEqual( document.querySelectorAll( '.reveal section video[src]' ).length, 1, 'Video source has been set' );
|
504
|
+
QUnit.test( 'video with data-src', function( assert ) {
|
505
|
+
assert.strictEqual( document.querySelectorAll( '.reveal section video[src]' ).length, 1, 'Video source has been set' );
|
508
506
|
});
|
509
507
|
|
510
|
-
test( 'audio with data-src', function() {
|
511
|
-
strictEqual( document.querySelectorAll( '.reveal section audio[src]' ).length, 1, 'Audio source has been set' );
|
508
|
+
QUnit.test( 'audio with data-src', function( assert ) {
|
509
|
+
assert.strictEqual( document.querySelectorAll( '.reveal section audio[src]' ).length, 1, 'Audio source has been set' );
|
512
510
|
});
|
513
511
|
|
514
|
-
test( 'iframe with data-src', function() {
|
512
|
+
QUnit.test( 'iframe with data-src', function( assert ) {
|
515
513
|
Reveal.slide( 0, 0 );
|
516
|
-
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
|
514
|
+
assert.strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
|
517
515
|
Reveal.slide( 2, 1 );
|
518
|
-
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 1, 'Iframe source is set' );
|
516
|
+
assert.strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 1, 'Iframe source is set' );
|
519
517
|
Reveal.slide( 2, 2 );
|
520
|
-
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
|
518
|
+
assert.strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
|
521
519
|
});
|
522
520
|
|
523
|
-
test( 'background images', function() {
|
521
|
+
QUnit.test( 'background images', function( assert ) {
|
524
522
|
var imageSource1 = Reveal.getSlide( 0 ).getAttribute( 'data-background-image' );
|
525
523
|
var imageSource2 = Reveal.getSlide( 1, 0 ).getAttribute( 'data-background' );
|
526
524
|
|
527
525
|
// check that the images are applied to the background elements
|
528
|
-
ok( Reveal.getSlideBackground( 0 ).style.backgroundImage.indexOf( imageSource1 ) !== -1, 'data-background-image worked' );
|
529
|
-
ok( Reveal.getSlideBackground( 1, 0 ).style.backgroundImage.indexOf( imageSource2 ) !== -1, 'data-background worked' );
|
526
|
+
assert.ok( Reveal.getSlideBackground( 0 ).querySelector( '.slide-background-content' ).style.backgroundImage.indexOf( imageSource1 ) !== -1, 'data-background-image worked' );
|
527
|
+
assert.ok( Reveal.getSlideBackground( 1, 0 ).querySelector( '.slide-background-content' ).style.backgroundImage.indexOf( imageSource2 ) !== -1, 'data-background worked' );
|
530
528
|
});
|
531
529
|
|
532
530
|
|
@@ -535,11 +533,13 @@ Reveal.addEventListener( 'ready', function() {
|
|
535
533
|
|
536
534
|
QUnit.module( 'Events' );
|
537
535
|
|
538
|
-
|
539
|
-
expect( 3 );
|
536
|
+
QUnit.test( 'slidechanged', function( assert ) {
|
537
|
+
assert.expect( 3 );
|
538
|
+
var done = assert.async( 3 );
|
540
539
|
|
541
540
|
var _onEvent = function( event ) {
|
542
|
-
ok( true, 'event fired' );
|
541
|
+
assert.ok( true, 'event fired' );
|
542
|
+
done();
|
543
543
|
}
|
544
544
|
|
545
545
|
Reveal.addEventListener( 'slidechanged', _onEvent );
|
@@ -550,17 +550,17 @@ Reveal.addEventListener( 'ready', function() {
|
|
550
550
|
Reveal.slide( 3, 0 ); // should trigger
|
551
551
|
Reveal.next(); // should do nothing
|
552
552
|
|
553
|
-
start();
|
554
|
-
|
555
553
|
Reveal.removeEventListener( 'slidechanged', _onEvent );
|
556
554
|
|
557
555
|
});
|
558
556
|
|
559
|
-
|
560
|
-
expect( 1 );
|
557
|
+
QUnit.test( 'paused', function( assert ) {
|
558
|
+
assert.expect( 1 );
|
559
|
+
var done = assert.async();
|
561
560
|
|
562
561
|
var _onEvent = function( event ) {
|
563
|
-
ok( true, 'event fired' );
|
562
|
+
assert.ok( true, 'event fired' );
|
563
|
+
done();
|
564
564
|
}
|
565
565
|
|
566
566
|
Reveal.addEventListener( 'paused', _onEvent );
|
@@ -568,16 +568,16 @@ Reveal.addEventListener( 'ready', function() {
|
|
568
568
|
Reveal.togglePause();
|
569
569
|
Reveal.togglePause();
|
570
570
|
|
571
|
-
start();
|
572
|
-
|
573
571
|
Reveal.removeEventListener( 'paused', _onEvent );
|
574
572
|
});
|
575
573
|
|
576
|
-
|
577
|
-
expect( 1 );
|
574
|
+
QUnit.test( 'resumed', function( assert ) {
|
575
|
+
assert.expect( 1 );
|
576
|
+
var done = assert.async();
|
578
577
|
|
579
578
|
var _onEvent = function( event ) {
|
580
|
-
ok( true, 'event fired' );
|
579
|
+
assert.ok( true, 'event fired' );
|
580
|
+
done();
|
581
581
|
}
|
582
582
|
|
583
583
|
Reveal.addEventListener( 'resumed', _onEvent );
|
@@ -585,13 +585,9 @@ Reveal.addEventListener( 'ready', function() {
|
|
585
585
|
Reveal.togglePause();
|
586
586
|
Reveal.togglePause();
|
587
587
|
|
588
|
-
start();
|
589
|
-
|
590
588
|
Reveal.removeEventListener( 'resumed', _onEvent );
|
591
589
|
});
|
592
590
|
|
593
|
-
|
594
591
|
} );
|
595
592
|
|
596
593
|
Reveal.initialize();
|
597
|
-
|