From: David Rodrigues Date: Thu, 3 Aug 2017 12:23:30 +0000 (-0300) Subject: Added tests to "ss" threshold localization to pt-br; X-Git-Tag: 2.19.0~26^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc032f71100964c3934a9613c854b1f9ca82239b;p=thirdparty%2Fmoment.git Added tests to "ss" threshold localization to pt-br; --- diff --git a/src/test/locale/pt-br.js b/src/test/locale/pt-br.js index a15c79f2b..c87240927 100644 --- a/src/test/locale/pt-br.js +++ b/src/test/locale/pt-br.js @@ -205,3 +205,17 @@ test('weeks year starting sunday format', function (assert) { assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3'); }); +test('relative time threshold', function (assert) { + var rts = moment(), + rtsDefault = moment.relativeTimeThreshold('ss'); + + moment.relativeTimeThreshold('ss', 3); + + rts.subtract(3, 'seconds'); + assert.equal(rts.fromNow(), 'poucos segundos atrás', 'Below custom a few seconds to seconds threshold'); + rts.subtract(1, 'seconds'); + assert.equal(rts.fromNow(), '4 segundos atrás', 'Above custom a few seconds to seconds threshold'); + + moment.relativeTimeThreshold('ss', rtsDefault); +}); +