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 zcmex=pQHEAm;@P_1sVSzVUTBFU}R+k0|qEyWMXDv zWn<^yn#iR?;+B1Vl97jh^& zZ9FI%bn%0VaZ*teCzqJGgrtbvx}>nyN9P&a7buactm7Wa!P7i zdPZheaY<=ec|~Pab4zPmdq-#2q{&mJPMbbs=B!1Fmn>bje8tLDn>KIRx^4T8ox2Vl zK63Qf@e?OcUAlbb>b2`PZr*zM=<$=M&z`?{`Re1R&tJZN`~KtSFOa_&8JNMo0ud08 zq4`UYfr*icg@u`got1@!fsv`4fsu(>kcCyzkWI)jkUgg2R zXn!L7kdEss^=JPXlz*LD=CiQ5aQmNKO+PVqzw-QLnY z@$Au)_5lmJzTQ>$@+he-N+GKTFH_E`y*~Wtar9-A0}FHtk8R?2V0->=>+#oOxz(#r zD@x2NzW(=}=YNKM9)Dh6Rpuy__4}3f>6S}I;O>1gwuT-e>B$L`eC2OtMA!lEgfAbyLD4XlIx2Viy8P2 zaA_~ywfzTwbHo{QuN8j|TxslnP}k1q7xgdf&%*9M**#Yu-J4}JuSxXrKlc9&*Vj9L zl-)k{L-%2Z9`T(!^Zyhn{?)pEaDI#Ve2IT*FQZ(X^JXVzOuzm~=7G~vz614pp0vsb zRfnGq>{)dsu_b=13gZh|Rt-j7(EVBO7qeSE&i*82k6 z+XL$^ByZf*r8#j*^ijE@BZ93DJJlH&&oi4oGOV$?ZpuBGxnl{(6Mnsf3!3cj^$vvm zt^8*Cvex;gsjqtO`kyy`-jNsi&yaoj*O57ux1T);3hSM^XnwqXtcm5zoc|2lmd#wm zFFR@ShLZ=i{J7ibC?= z3H%=uYHokH|IlsvqE~@gavD3k{#h5P_WK3?UY2*vuP%SN{WQn#=06TiylX$XAk6r- z=}rDSXNy+bpZLl1YpYGFWul_?=bGHoPnVZ3pSFJajn6giMqclC)}^Vh75(_(#~u#( zm+@;wZ@x{v^TT!Wh4_>o_m9X6Y?jC&iwRq=v+3wf|Q!le{(_;3??iLv@W^+PQUxdWbs)KA9MO$ zcvj}^svEsKHYnfw>)vhlaW#^^BP-ON$6Yo(>-N#)t`M)Cuixvl>gOLB*-UZ#Y@L@Q zu;9sdr*))Z>g!~=Mu~1y)kc>RX6-ttMQ*<+TzcP_Gtfh{m-!1HSudo>eu&%)935W zTzt%;_go~qo86;b{H)HhXXh=~IkD-q=$_Ize)a$W literal 0 HcmV?d00001 diff --git a/test/test-element-attributes-markdown.html b/test/test-element-attributes-markdown.html new file mode 100644 index 00000000..e547d161 --- /dev/null +++ b/test/test-element-attributes-markdown.html @@ -0,0 +1,84 @@ + + + + + + + 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 00000000..e79806c6 --- /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(); +