test-markdown-attributes.js 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. Reveal.addEventListener( 'ready', function() {
  2. QUnit.module( 'Markdown' );
  3. test( 'Vertical separator', function() {
  4. strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 3, 'found three vertical slides' );
  5. });
  6. test( 'Id on slide', function() {
  7. strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' );
  8. strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' );
  9. });
  10. test( 'data-background attributes', function() {
  11. strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' );
  12. strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' );
  13. strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' );
  14. });
  15. test( 'data-transition attributes', function() {
  16. strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' );
  17. strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' );
  18. strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' );
  19. });
  20. } );
  21. Reveal.initialize();