Permalink
Browse files

Added test for checking invalid properties

  • Loading branch information...
1 parent 3bb214f commit b0e75b5d428542e6cfb5b27c38253751d2e67b48 @KrofDrakula committed Feb 5, 2011
Showing with 19 additions and 0 deletions.
  1. +6 −0 test.html
  2. +13 −0 test.js
View
@@ -42,6 +42,12 @@ <h2 id="qunit-userAgent"></h2>
<li itemscope id="single-item-missing-property" itemtype="http://data-vocabulary.org/Event">
<p itemprop="summary">This is the event summary</p>
</li>
+
+ <!-- single item with both required properties, but one invalid property -->
+ <li itemscope id="single-item-invalid-property" itemtype="http://data-vocabulary.org/Event">
+ <p itemprop="summary">Event summary</p>
+ <time datetime="2011-08-05x" itemprop="startdate">Aug 5th 2011</time>
+ </li>
</ul>
</div>
</body>
View
13 test.js
@@ -59,4 +59,17 @@ $(function() {
}, 'Should return 1 good property and one missing');;
});
+
+ test('Single item with 1 invalid property per vocabulary rules', function() {
+
+ same($.microdata.parseElement($('#single-item-invalid-property')), {
+ type: "http://data-vocabulary.org/Event",
+ properties: [
+ { name: "summary", value: "Event summary", valid: true },
+ { name: "startdate", value: "2011-08-05x", valid: false }
+ ],
+ missing: [], valid: false
+ }, 'Should return 1 invalid property and invalid object');
+
+ });
});

0 comments on commit b0e75b5

Please sign in to comment.