diff options
author | VonC <vonc@laposte.net> | 2013-10-14 13:37:48 +0200 |
---|---|---|
committer | VonC <vonc@laposte.net> | 2013-11-04 16:31:37 +0100 |
commit | 4def7f116c932b9e713545fcde3054d293647dc9 (patch) | |
tree | ffcc72b5a86c1e663b220297fe5dee641762b39d /test/test-markdown-attributes.js | |
parent | 83ee2eb00e66124376e404b15ba8ca58d8221f85 (diff) | |
download | fosdem-2018-presentation-4def7f116c932b9e713545fcde3054d293647dc9.tar fosdem-2018-presentation-4def7f116c932b9e713545fcde3054d293647dc9.tar.gz |
Add QUnit.js unit tests for attributes in Markdown slides.
Diffstat (limited to 'test/test-markdown-attributes.js')
-rw-r--r-- | test/test-markdown-attributes.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test-markdown-attributes.js b/test/test-markdown-attributes.js new file mode 100644 index 0000000..a0d8436 --- /dev/null +++ b/test/test-markdown-attributes.js @@ -0,0 +1,31 @@ + + +Reveal.addEventListener( 'ready', function() { + + QUnit.module( 'Markdown' ); + + test( 'Vertical separator', function() { + strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 3, 'found three vertical slides' ); + }); + + test( 'Id on slide', function() { + strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' ); + strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' ); + }); + + test( 'data-background attributes', function() { + strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); + strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); + strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); + }); + + test( 'data-transition attributes', function() { + strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); + strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); + strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' ); + }); + +} ); + +Reveal.initialize(); + |