From: Timothy Z Searcy Date: Fri, 18 Jan 2019 03:08:52 +0000 (-0800) Subject: [tests] relative time threshold doesn't work for multiple (#4913) X-Git-Tag: 2.24.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9598c262af44bc9ccac7d07f086a4c61d0b6207;p=thirdparty%2Fmoment.git [tests] relative time threshold doesn't work for multiple (#4913) * [bugfix] relative time threshold doesn't work for multiple * return humanize to normal --- diff --git a/src/test/moment/relative_time.js b/src/test/moment/relative_time.js index c2bbf6fa2..f1ea491cb 100644 --- a/src/test/moment/relative_time.js +++ b/src/test/moment/relative_time.js @@ -148,6 +148,16 @@ test('custom thresholds', function (assert) { a.subtract(1, 'months'); assert.equal(a.fromNow(), 'a year ago', 'Above custom days to years threshold'); moment.relativeTimeThreshold('M', 11); + + // multiple thresholds + moment.relativeTimeThreshold('ss', 3); + a = moment(); + a.subtract(4, 'seconds'); + assert.equal(a.fromNow(), '4 seconds ago', 'Before setting s relative time threshold'); + moment.relativeTimeThreshold('s', 59); + assert.equal(a.fromNow(), 'a few seconds ago', 'After setting s relative time threshold'); + moment.relativeTimeThreshold('ss', 44); + moment.relativeTimeThreshold('s', 45); }); test('custom rounding', function (assert) {