Skip to content

Commit 9b79003

Browse files
committed
Cleanup disposed tests
1 parent 441a734 commit 9b79003

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

test/index.html

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ <h2>Do Not Allow Past</h2>
230230
</ul>
231231

232232
<h2>Disposal</h2>
233-
<p><abbr class="disposal disposed"></abbr></p>
234-
<p><abbr class="disposal notDisposed"></abbr></p>
233+
<p><abbr id="testDisposed" class="disposal"></abbr></p>
235234
</div>
236235

237236
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
@@ -713,22 +712,14 @@ <h2>Disposal</h2>
713712
module("Disposal");
714713

715714
asyncTest("disposal", function() {
716-
var disposed = $(".disposal.disposed");
717-
var active = $(".disposal.notDisposed");
718-
disposed.timeago('dispose');
715+
var disposed = $("#testDisposed");
716+
disposed.timeago("dispose");
719717
var initialTime_disposedTimeago = disposed.html();
720-
var initialTime_activeTimeago = active.html();
721718

722-
expect(2);
719+
expect(1);
723720
setTimeout(function() {
724721
var updatedTime_disposedTimeago = disposed.html();
725-
var updatedTime_activeTimeago = active.html();
726-
727-
ok(initialTime_disposedTimeago === updatedTime_disposedTimeago, "A disposed timeago didn't get updated");
728-
ok(initialTime_activeTimeago !== updatedTime_activeTimeago, "A non-disposed timeago continued to be updated");
729-
730-
// Dispose still-active timeago
731-
active.timeago('dispose');
722+
ok(initialTime_disposedTimeago === updatedTime_disposedTimeago, "A disposed timeago continued to update");
732723
resetRefreshMillis();
733724
start();
734725
}, 50);

test/test_helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function unloadCutoffSetting() {
3131
}
3232

3333
function setupDisposal() {
34-
jQuery.timeago.settings.refreshMillis = 50;
34+
jQuery.timeago.settings.refreshMillis = 25;
3535
$('abbr.disposal').attr("title", iso8601(new Date())).timeago();
3636
}
3737

0 commit comments

Comments
 (0)