Permalink
Browse files

Add tests for title attribute preservation of time tags.

  • Loading branch information...
1 parent c613a87 commit c8ca83c78db6bfec30307741e6881620c37b3833 @jgraichen jgraichen committed May 10, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/index.html
View
@@ -73,6 +73,9 @@ <h2 id="qunit-userAgent"></h2>
<p>Date only (default tooltip): <abbr id="defaultTooltip" class="timeago" title="2008-02-26"> </abbr>.</p>
<p>Timestsamp (with millis): <abbr class="timeago" title="1978-12-18T17:17:00.021Z">(you shouldn't see this)</abbr>.</p>
+ <p><time id="testTimeTitle" class="timeago" datetime="2012-05-07T10:06:02+02:00" title="May 10, 2012 10:06">May 10, 2012</time></p>
+ <p><time id="testTimeTitle2" class="timeago" datetime="2012-05-07T10:06:02+02:00">May 10, 2012</time></p>
+
<h2>Errors</h2>
<p>Bad (letters): <abbr class="bad timeago" title="bleh">(this should be displayed)</abbr>.</p>
@@ -302,6 +305,14 @@ <h2 id="qunit-userAgent"></h2>
ok($("#defaultTooltip").attr("title") == "2008-02-26", "correctly set");
});
+ test("should preserve title in time tags", function () {
+ ok(($("#testTimeTitle").attr('title') === "May 10, 2012 10:06"), "title preserved")
+ });
+
+ test("should set title in time tags without a title", function () {
+ ok(($("#testTimeTitle2").attr('title') === "May 10, 2012"), "title set")
+ });
+
module("Parsing");
// Note, different browsers behave slightly different

0 comments on commit c8ca83c

Please sign in to comment.