aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVonC <vonc@laposte.net>2013-10-29 14:29:01 +0100
committerVonC <vonc@laposte.net>2013-11-04 16:31:54 +0100
commit1774de2113aacb7fc2f0b0537d691c940c17caf5 (patch)
tree16c7590259e62924b94e94b7ac8c9a6f147f4c18 /test
parent2cdd1afe85d027089bdb30689536e8743d7bb4ba (diff)
downloadfosdem-2018-presentation-1774de2113aacb7fc2f0b0537d691c940c17caf5.tar
fosdem-2018-presentation-1774de2113aacb7fc2f0b0537d691c940c17caf5.tar.gz
Add unit test for default slide attributes separator pattern.
Diffstat (limited to 'test')
-rw-r--r--test/test-markdown-attributes.html32
-rw-r--r--test/test-markdown-attributes.js13
2 files changed, 44 insertions, 1 deletions
diff --git a/test/test-markdown-attributes.html b/test/test-markdown-attributes.html
index ed49ad4..262c6ae 100644
--- a/test/test-markdown-attributes.html
+++ b/test/test-markdown-attributes.html
@@ -55,6 +55,38 @@
</script>
</section>
+ <section data-markdown data-separator="^\n\n\n"
+ data-vertical="^\n\n"
+ data-notes="^Note:"
+ data-charset="utf-8">
+ <script type="text/template">
+ # Test attributes in Markdown with default separator
+ ## Slide 1 Def
+
+
+
+ ## Slide 2 Def
+ <!-- slide-attributes: id="slide2def" data-transition="concave" data-background="#A7C66B" -->
+
+
+ ## Slide 2.1 Def
+ <!-- slide-attributes: data-background="#f70000" data-transition="page" -->
+
+
+ ## Slide 2.2 Def
+ [Link to Slide2](#/slide2def)
+
+
+
+ ## Slide 3 Def
+ <!-- slide-attributes: data-transition="concave" data-background="#C7916B" -->
+
+
+
+ ## Slide 4
+ </script>
+ </section>
+
</div>
</div>
diff --git a/test/test-markdown-attributes.js b/test/test-markdown-attributes.js
index a0d8436..3e88341 100644
--- a/test/test-markdown-attributes.js
+++ b/test/test-markdown-attributes.js
@@ -5,7 +5,7 @@ Reveal.addEventListener( 'ready', function() {
QUnit.module( 'Markdown' );
test( 'Vertical separator', function() {
- strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 3, 'found three vertical slides' );
+ strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' );
});
test( 'Id on slide', function() {
@@ -25,6 +25,17 @@ Reveal.addEventListener( 'ready', function() {
strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' );
});
+ test( 'data-background attributes with default separator', function() {
+ strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
+ strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
+ strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
+ });
+
+ test( 'data-transition attributes with default separator', function() {
+ strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
+ strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
+ strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' );
+ });
} );
Reveal.initialize();