Skip to content

Commit 5662637

Browse files
committed
Add Microdata test
1 parent fc1eaca commit 5662637

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/test_ppx.ml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,26 @@ let attribs = "ppx attribs", HtmlTests.make Html.[
303303
[[%html "<div aria-hidden=true></div>"]],
304304
[div ~a:[a_aria "hidden" ["true"]] []] ;
305305

306+
"microdata attributes",
307+
[[%html "<dl itemscope itemtype='https://md.example.com/track https://md.example.com/lighting'><dt>Name</dt><dd itemprop='name'>Turnout Lantern Kit</dd><dt>Purpose<dd>For retrofitting 2 <span itemprop='track-type'>C</span> Track turnouts.<meta itemprop='scale' content='HO'></dl>"]],
308+
[dl
309+
~a: [
310+
a_itemscope ();
311+
a_itemtype ["https://md.example.com/track"; "https://md.example.com/lighting"];
312+
]
313+
[
314+
dt [txt "Name"];
315+
dd ~a: [a_itemprop "name"] [txt "Turnout Lantern Kit"];
316+
dt [txt "Purpose"];
317+
dd
318+
[
319+
txt "For retrofitting 2 ";
320+
span ~a: [a_itemprop "track-type"] [txt "C"];
321+
txt " Track turnouts.";
322+
meta_itemprop "scale" ~a: [a_content "HO"] ();
323+
]
324+
]];
325+
306326
"touch events",
307327
[[%html "<div ontouchstart='alert()'></div>"]],
308328
[div ~a:[a_ontouchstart "alert()"] []] ;

0 commit comments

Comments
 (0)