]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Added tests to "ss" threshold localization to pt-br;
authorDavid Rodrigues <david.proweb@gmail.com>
Thu, 3 Aug 2017 12:23:30 +0000 (09:23 -0300)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 7 Aug 2017 00:31:21 +0000 (03:31 +0300)
src/test/locale/pt-br.js

index a15c79f2b72e0a638553816e9c4c693a80aa7dcb..c87240927042eea10447f084aaf7b60282fdb928 100644 (file)
@@ -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);
+});
+