Permalink
Browse files

Added tests for HTML5 <time> element support

  • Loading branch information...
rmm5t committed Oct 25, 2009
1 parent 39a0519 commit a5c1424d6940034e49525ce282dc05d1724ffcc1
Showing with 12 additions and 4 deletions.
  1. +1 −1 index.html
  2. +11 −3 test/index.html
View
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="microid" content="mailto+http:sha1:566841e568e84b46c92d2291b44b836dfddc5c42" />
<title>timeago: a jQuery plugin</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="jquery.timeago.js" type="text/javascript"></script>
<script src="test/test_helpers.js" type="text/javascript"></script>
<script type="text/javascript">
View
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- use http://code.jquery.com/jquery-latest.js for the latest jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<!-- http://dev.jquery.com/view/trunk/qunit/testrunner.js -->
<script src="testrunner.js" type="text/javascript"></script>
@@ -24,7 +24,7 @@ <h2 id="userAgent"></h2>
<div id="main">
<h2>Short term</h2>
<p>You opened this page <abbr class="loaded timeago testShortTerm">sometime before now</abbr>.</p>
<p>You opened this page <abbr class="loaded timeago testShortTerm">(you shouldn't see this)</abbr>.</p>
<p>
This page was last modified <abbr class="modified timeago">sometime before
@@ -66,7 +66,8 @@ <h2>Long term</h2>
<h2>Other formats</h2>
<p>Date only: <abbr class="timeago" title="2008-02-26">(you shouldn't see this)</abbr>.</p>
<p>Date only (abbr element): <abbr class="timeago" title="2008-02-26">(you shouldn't see this)</abbr>.</p>
<p>Date only (time element): <time class="timeago" datetime="2008-02-26">(you shouldn't see this)</time>.</p>
<h2>Errors</h2>
@@ -193,6 +194,7 @@ <h2>Settings</h2>
$('abbr.modified').attr('title', iso8601(new Date(document.lastModified)));
$('abbr.timeago').timeago();
$('time.timeago').timeago();
$('abbr.todate').each(function () {
var date = $.timeago.parse(this.title);
@@ -218,6 +220,12 @@ <h2>Settings</h2>
}), 'All text was replaced');
});
test('Text in time tag should be replaced', function () {
ok(testElements('time.timeago', function (element) {
return (element.html() !== "(you shouldn't see this)");
}), 'All text was replaced');
});
module('Invalid date');
test('Text in abbr should not be replaced', function () {

0 comments on commit a5c1424

Please sign in to comment.