4 <script src="../../js/resources/js-test-pre.js"></script>
5 <script src="resources/microdata-common.js"></script>
8 <p>itemid attribute simple test.</p>
9 <div id="console"></div>
11 var element = createElement('div', {itemid: 'http://example.com/foo'});
13 debug("<br>The itemId attribute must be defined.");
14 shouldBeDefined("element.itemId");
15 shouldBe("element.itemId", "'http://example.com/foo'");
17 debug("<br>itemId attribute must be case-senaitive.");
18 shouldBeTrue("createElement('div', {itemid: 'http://example.com/FOO'}).itemId == 'http://example.com/FOO';");
20 debug("<br>itemId must strip leading and trailing whitespace.");
21 shouldBeTrue("createElement('div', {itemid: ' http://example.com/foo '}).itemId == 'http://example.com/foo';");
23 debug("<br>itemId must strip leading whitespace.");
24 shouldBeTrue("createElement('div', {itemid: ' http://example.com/foo'}).itemId == 'http://example.com/foo';");
26 debug("<br>itemId must strip trailing whitespace.");
27 shouldBeTrue("createElement('div', {itemid: 'http://example.com/foo '}).itemId == 'http://example.com/foo';");
29 debug("<br>itemId must be read/write.");
30 shouldBeTrue("element.itemId = 'http://example.com/bar'; element.itemId == 'http://example.com/bar'");
33 <script src="../../js/resources/js-test-post.js"></script>