From f92f2fdea631058bfca204dc0a620b3cc0188868 Mon Sep 17 00:00:00 2001 From: VonC Date: Sun, 27 Oct 2013 19:57:12 +0100 Subject: [PATCH] Add unit-tests for attributes in mardown elements. Test paragraphs, list items and img attributes. --- test/red-curtain-50x50.jpg | Bin 0 -> 1995 bytes test/test-element-attributes-markdown.html | 84 +++++++++++++++++++++ test/test-element-attributes-markdown.js | 38 ++++++++++ 3 files changed, 122 insertions(+) create mode 100644 test/red-curtain-50x50.jpg create mode 100644 test/test-element-attributes-markdown.html create mode 100644 test/test-element-attributes-markdown.js diff --git a/test/red-curtain-50x50.jpg b/test/red-curtain-50x50.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ddfe7a637d747dedc7c7c71a01431e7e76e0eb6f GIT binary patch literal 1995 zcmbW!XH=6}8UWxg`O-)TNgx4q1`|LjA}9z$Q$sOS1%paeihwjh2}KZu6~qE4V1$fV zkY+5$QCSgD9EgD6Vr)nY76?KFLw0KiNqk02m}&~Mx!w5Sao$A7Kg)YXcF-n zBn=#ns7)kkktr04IzdNQo2;uzrjVB|fq|+s2&5VksYb@*@Z|qFpf-Sn0jvNk5M}_t zNidKEgE|1J3W%IClKR$-*=2v*i_>U(Z$6)YjEs;a9T<&ZqQkmkXuujJ-Tk z53?fMyitJCRX(s*xYZOJ>kzumNz-d1NMbMSy>BA?=?v%KLN0Gpk7f6$FK%^Qe9dd= z`QqI9v(JsD+l6Bxz1D4)*Can_AUL5!%Eqo~?Zm7bJ^H$pDFcgNJR#tB55;t!Atp`F zN4|GXusN3b@LFkU$6+FUtR%R3cKgWU_bz%-rTg)_g95`F?=x`*#YI`+Db}qFr)1?P zy=g(af5k-z@Xv|36ul#uE!e&k8imN?bnWoxbhWgRat^(-?)x zErE=_7r)js&+(^_WWC0Q6MGn+uGRvCHmq6wgC-dvKk%8Y*HuN^nLNu#ai8#grPZZ8%9s)j0Ry*O#d=NUvqkMdu}*XIeg#W^arFSN>Zom%uF_~Sc(ZHL z`G{D~z}(LxF7+C1xh)?HsD4=id}i_WH_X#trS9_;34W(Rq=WQgE&0|QTU8pZ&O;rQ zh*{YoJKgv1*QC64o7zzaYBYa~ye;aT4kV)9NX-`A;@~{^zV((1J4&U%Ta6QMEetNarIH~ap;z8JJ{;RnjhlWe~O|- zE|wC+;n~BpA4c6cHB-#^6(-GvN=MeJ5+CM|D@jj$a`toS70%ynWsl3=(b)(5*ALqa z5#I7yH|X69>hi`7(e@GgW|Hj0w7Fg`x8fFeP?GI#<@L2WXRq;1ig;Gmf}u`^-J}f7 zM8B0W*e}DPWFI=H#Jd+=d6gC=YUgLPHN8bTPB%EKQT8vmNy27dtRhhy#)E*LgA)$< z)URr3?~$0lDbM>tSP&V+sM{GfqwQ#gk_@TV^$$Jz$@n^!*)HE#=~t;H^4pVvp@x0< zcO3`8ammh$D2)SA*=foPJHywNRx=$_2fnN=lCgCvN5|BBUQVQYGt5IC?)Ka7Eq!#4 z9-6)EM^J{5D74px?r-|RR)n}S-{6c88;jFX7F=-$1vZDH7N*HE3j57bQRVRT{ zxst$*<=9I2k+GtQJXGngFMkx!awwu!eCkFwz4+Htb2?`x=9oG|CwqWEJXc{>);}Yf z?SFV}QU`zTvqgPlY5tRsEUuLD$>na0ZBK(`HD^Oj!E)&rF4M7d-ise6N_qPw$8?!2 z=>G6&eE3uGroeH*D&rN>F?3Kyn0|?93un9J`N)BUOZ7IUl2m){sa-Qyvi>H!X#xQi zwUU|^vmXoyc*Ka1Mny}%T5_r^&ecA#JM}yW?Y2qyfPi$><6q*g>2BzuwB*?)SNH@} zZ*-`7_KJ}ZBJ=G#wp+RAt+0fE*S@U&$Up^Mc&^-qPZbQU1l8-DJZRr|6Te5hcuX@W oot#{?sw^S;hm< + + + + + + reveal.js - Test Markdown + + + + + + + +
+
+ + + + + + + + + + + + + diff --git a/test/test-element-attributes-markdown.js b/test/test-element-attributes-markdown.js new file mode 100644 index 0000000..e79806c --- /dev/null +++ b/test/test-element-attributes-markdown.js @@ -0,0 +1,38 @@ + + +Reveal.addEventListener( 'ready', function() { + + QUnit.module( 'Markdown' ); + + test( 'Vertical separator', function() { + strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' ); + }); + + + test( 'Attributes on vertical slides header', function() { + strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' ); + strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' ); + }); + + test( 'Attributes on vertical slides paragraphs', function() { + strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' ); + }); + + test( 'Attributes on vertical slides list items', function() { + strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.roll-in' ).length, 3, 'found a vertical slide with three list items with class fragment.roll-in' ); + }); + + test( 'Attributes on horizontal slides paragraphs', function() { + strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' ); + }); + test( 'Attributes on horizontal slides list items', function() { + 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' ); + }); + test( 'Attributes on horizontal slides list items', function() { + strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' ); + }); + +} ); + +Reveal.initialize(); +