OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../js/resources/js-test-pre.js"></script> | |
5 <script src="resources/microdata-common.js"></script> | |
6 </head> | |
7 <body> | |
8 <p>This test that the itemRef should be correct for an element that has itemRef
attribute.</p> | |
9 <div id="console"></div> | |
10 <script> | |
11 var element = createElement('div', {itemref: 'foo bar FOO FOo'}); | |
12 | |
13 shouldBeTrue("element.itemRef.length == 4"); | |
14 shouldBeTrue("element.itemRef.toString() == 'foo bar FOO FOo'"); | |
15 shouldBeTrue("element.itemRef.item(0) == 'foo'"); | |
16 shouldBeTrue("element.itemRef.item(1) == 'bar'"); | |
17 shouldBeTrue("element.itemRef[0] == 'foo'"); | |
18 shouldBeTrue("element.itemRef[1] == 'bar'"); | |
19 shouldBeTrue("element.itemRef.contains('bar')"); | |
20 shouldBeTrue("element.itemRef.contains('foo')"); | |
21 | |
22 debug("<br>itemRef should return case-sensitive strings."); | |
23 shouldBeTrue("element.itemRef.item(2) == 'FOO'"); | |
24 shouldBeTrue("element.itemRef[2] == 'FOO'"); | |
25 shouldBeTrue("element.itemRef.item(3) == 'FOo'"); | |
26 shouldBeTrue("element.itemRef[3] == 'FOo'"); | |
27 | |
28 debug("<br>itemRef should not contain an undefined token."); | |
29 shouldBeFalse("element.itemRef.contains('test')"); | |
30 | |
31 debug("<br>itemRef.length should be 0 if element has not tokens."); | |
32 var element1 = createElement('div', {itemRef: ''}); | |
33 shouldBeTrue("element1.itemRef.length == 0"); | |
34 | |
35 </script> | |
36 <script src="../../js/resources/js-test-post.js"></script> | |
37 </body> | |
38 </html> | |
OLD | NEW |