From 1774de2113aacb7fc2f0b0537d691c940c17caf5 Mon Sep 17 00:00:00 2001 From: VonC Date: Tue, 29 Oct 2013 14:29:01 +0100 Subject: [PATCH] Add unit test for default slide attributes separator pattern. --- test/test-markdown-attributes.html | 32 ++++++++++++++++++++++++++++++ test/test-markdown-attributes.js | 13 +++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) 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 @@ -51,6 +51,38 @@ + ## Slide 4 + + + +
+
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(); -- 2.26.2